Tutorial:installing samtools with conda - overcoming two common errors
2
16
Entering edit mode
3.3 years ago

Posting this here to help others.

Question - trying to install samtools with conda and encountering this error:

samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

or this error:

samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

This seems to resolve both errors (or at least it worked for me):

conda install "samtools>=1.10"

Note the use of ", they are important.

samtools conda • 32k views
ADD COMMENT
1
Entering edit mode

In Ubuntu 20.04 in a Windows WSL2 VM tried the conda install -c bioconda "samtools>=1.10" and got a bunch of "Package conflicts for:" zlib, libstdcxx-ng, libgcc-ng, and ncurses

ADD REPLY
0
Entering edit mode

This is the only solution that worked for me, trying to install samtools into a named conda environment. Other variations generated conflicts.

ADD REPLY
0
Entering edit mode

I face this problem with bcftools. I solved it via a Docker container

ADD REPLY
0
Entering edit mode

I solved my problem with libssl1.0.0 like this:

First I uninstalled samtools from my conda env, then I opened http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/ in my browser and download last version of libssl1.0.0 for my system (for me it was libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb) Then I just install it:

sudo gdebi ./libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb

And after that I installed samtools again. Paulo

ADD REPLY
1
Entering edit mode

Thus defeating the entire purpose of conda, which is to not alter the libraries that your system needs/uses.

ADD REPLY
0
Entering edit mode

That's not recommended, as conda is supposed to take full care of the dependency environment. Do what is done in the accepted answer, this will work. Make a new environment and install samtools into this one, that is always a good idea to avoid cross-environment contamination and avoid overloading individual envs. By the way, what you suggest only works if you have root permission, which on e.g. a HPC will never be the case.

ADD REPLY
15
Entering edit mode
2.9 years ago
darklings ▴ 550
conda config --add channels bioconda
conda config --add channels conda-forge
conda install samtools==1.11

works for me

ADD COMMENT
2
Entering edit mode

The order of channels should be (in file $HOME/.condarc)

channels:
  - conda-forge
  - bioconda
  - defaults

This should then take care of the dependencies and correct versions.

ADD REPLY
0
Entering edit mode

Thanks a lot ! Worked for me on Ubuntu 20.04

ADD REPLY
0
Entering edit mode

Thank you so much darklings

ADD REPLY
0
Entering edit mode

worked for Ubuntu 20.04.3 Thanks!

I had an error: samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory tried to install libcrypto, but failed.

ADD REPLY
0
Entering edit mode

Thank you so so much! I tried many ways and this one finally worked on a Python 2.7 environment

ADD REPLY
0
Entering edit mode

I toggle this as "accepted answer" since it is the best way to tackle the problem. If you on top of that use mamba instead of conda it runs even faster.

ADD REPLY
1
Entering edit mode
2.6 years ago
BioRyder ▴ 220
conda install -c bioconda samtools openssl=1.0

this will solve the problem.

ADD COMMENT

Login before adding your answer.

Traffic: 1595 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6