# OSError: cannot load library

**URL:** <https://forum.biobakery.org/t/oserror-cannot-load-library/4583>\
**Category:** LEfSe\
**Created:** [December 31, 2022, 2:37am UTC](https://forum.biobakery.org/t/oserror-cannot-load-library/4583 "2022-12-31T02:37:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![B-1991-ing](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/b-1991-ing/32/1842_2.png) [@B-1991-ing](https://forum.biobakery.org/u/B-1991-ing)\
**Post date:** [December 31, 2022, 2:37am UTC](https://forum.biobakery.org/t/oserror-cannot-load-library/4583/1 "2022-12-31T02:37:51Z")

</div>

Dear Lefse development team,

I ran the already installed lefse on our HPC server. Error happened when running the lefse\_run.py.  
module load tools  
module load ngs  
module load anaconda3/2022.10  
module load intel/perflibs/64/2020\_update2  
module load gcc/7.4.0  
module load R/4.2.0  
export LD\_LIBRARY\_PATH=/services/tools/R/4.2.0  
tsv\_dir=/relative\_proportion\_tsv/  
diff\_dir=/differential\_analysis/  
lefse\_format\_input.py ${tsv\_dir}proportion1.tsv ${diff\_dir}proportion1.in -c 1 -s 3 -u 2 -o 1000000  
**lefse\_run.py ${diff\_dir}proportion1.in ${diff\_dir}proportion1.res**

 ![Screenshot 2022-12-31 at 03.35.56](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/c/c1374595481253b686bd3e235959a6b405c95d99.png)

Could you give some hints to solve the problem according to your experience?

Best,

Bing

---

<div class="post-metadata">

**Author:** ![B-1991-ing](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/b-1991-ing/32/1842_2.png) [@B-1991-ing](https://forum.biobakery.org/u/B-1991-ing)\
**Post date:** [December 31, 2022, 10:09pm UTC](https://forum.biobakery.org/t/oserror-cannot-load-library/4583/2 "2022-12-31T22:09:19Z")

</div>

**Update**  
It works now after reinstallation under my own directory on HPC.

# Reinstallation

module load tools #pre for miniconda3/4.12.0  
module load miniconda3/4.12.0  
module load intel/perflibs/64/2020\_update2  
module load gcc/7.4.0  
module load R/4.2.0  
**Create lefse environment**  
conda create -n lefse  
**Activate lefse environment**  
conda activate lefse  
**Install lefse through bioconda channel**  
conda install -c conda-forge -c bioconda lefse

# Command lines

tsv\_dir=/tsv\_dir/  
diff\_dir=/differential\_analysis/  
for r in Phylum Class Order Family Genus Species ;  
do  
lefse\_format\_input.py ${tsv\_dir}${r}proportion.tsv ${diff\_dir}${r}proportion.in -c 2 -s 1 -u 3 -o 1000000  
lefse\_run.py ${diff\_dir}${r}proportion.in ${diff\_dir}${r}proportion.res  
lefse\_plot\_res.py ${diff\_dir}${r}proportion.res ${diff\_dir}${r}proportion.pdf --feature\_font\_size 8 --title\_font\_size 8 --class\_legend\_font\_size 8 --format pdf --dpi 300  
lefse\_plot\_cladogram.py ${diff\_dir}${r}proportion.res ${diff\_dir}${r}proportion\_cladogram.pdf --format pdf  
done

Best,

Bing

---

<div class="post-metadata">

**Author:** ![mishort](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/mishort/32/556_2.png) [@mishort](https://forum.biobakery.org/u/mishort)\
**Post date:** [January 31, 2023, 6:49pm UTC](https://forum.biobakery.org/t/oserror-cannot-load-library/4583/3 "2023-01-31T18:49:20Z")

</div>

Hello Bing,  
Thank you for the update and I’m glad you were able to find a solution.  
Best,  
Meg
