samtools / Installation errors

Causes and fixes for samtools installation errors

Common samtools, bcftools and htslib errors from conda installs and source builds, listed by exact message, each with its cause and fix.

Short answer

samtools depends on htslib and system libraries such as zlib, bzip2, lzma and OpenSSL, and with the wrong conda channel order you get an old build with outdated dependencies that fails to find libcrypto or libncurses at runtime.

Setting up your environment this way avoids most errors on this page.

PracticeWhat happens if you skip it
Put conda-forge before bioconda in your conda channels and set channel_priority to strict.You get a samtools build that depends on an old OpenSSL and fails with libcrypto.so.1.0.0 not found.
Create a separate conda environment for bioinformatics tools instead of using base.Tools overwrite each other's dependencies and installs fail with Package conflicts.
On Windows, install WSL2 (the Linux subsystem built into Windows) and install samtools inside it.Windows conda has no samtools package, so installs fail with PackagesNotFoundError.
Before building from source, install the zlib, bzip2, xz, curl and ncurses development packages.configure stops with development files not found, and disabling bzip2 or lzma to skip the check leaves some CRAM files unreadable.
Do not install old system libraries by hand (for example libssl1.0.0) to silence the error.The problem is only postponed, and the next tool that needs the old library fails the same way.

Troubleshooting by error message

Find your exact error message. Each entry gives the cause, the fix, and what may come up after the fix.

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

Cause: The conda channel order is wrong, so you got a samtools build that depends on an old OpenSSL.

Fix: Remove samtools, put conda-forge before bioconda with channel_priority strict, then install it again.

What may come next: After changing the channel order, other packages in the environment may need updating too; run conda update --all if needed.

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

Cause: You installed an old samtools (for example 1.2) that depends on an old ncurses.

Fix: Run conda install "samtools>=1.10"; keep the quotes around the version condition.

PackagesNotFoundError: The following packages are not available from current channels: samtools

Cause: bioconda only builds for Linux and macOS, so Windows conda has no samtools.

Fix: Install WSL2 and install samtools with conda inside its Linux environment.

What may come next: You will need conda and your other tools again inside WSL2, and the data must be somewhere WSL2 can reach.

dyld: Library not loaded: @rpath/libcrypto.1.0.0.dylib

Cause: macOS picked an outdated samtools build that depends on an OpenSSL version that no longer exists.

Fix: Reinstall a specific newer version, such as conda install samtools=1.15.1; if that still fails on an Apple silicon Mac, use brew install samtools.

What may come next: A Homebrew samtools lives outside your conda environment, so check which one your scripts actually call.

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

Cause: conda chose an old bcftools (for example 1.8) that depends on an old OpenSSL.

Fix: Reinstall with bcftools>=1.9, or fix the channel order first and then reinstall.

What may come next: conda install bcftools openssl=1.0 also removes the error, but it pulls an old OpenSSL into the environment and other tools may then conflict.

bcftools does not exist (perhaps a typo or a missing channel).

Cause: mamba only searched the default channels because bioconda was not added.

Fix: Add the conda-forge and bioconda channels, then install again.

Package conflicts for: (involving zlib, libstdcxx-ng, libgcc-ng and ncurses)

Cause: The zlib, ncurses and other packages already in the environment conflict with what the new samtools needs.

Fix: Create a clean conda environment with only samtools and the tools it needs.

What may come next: Forcing a solve in the old environment is slow and may downgrade tools that already work.

zlib development files not found

Cause: The zlib development package is missing when building from source.

Fix: Install zlib1g-dev on Debian or Ubuntu, or zlib-devel on RHEL or CentOS.

What may come next: After zlib, htslib also checks for bzip2, lzma, curl and other development packages, which usually need installing too.

curses development files not found

Cause: The ncurses development package is missing, and samtools tview needs it.

Fix: Install libncurses5-dev on Debian or Ubuntu or ncurses-devel on RHEL or CentOS; if you do not need tview, run ./configure --without-curses.

HTSlib development files not found

Cause: configure cannot find an htslib source tree or an installed htslib.

Fix: Point to the htslib source or install folder with ./configure --with-htslib=DIR.

What may come next: htslib and samtools versions must match; mixing versions causes build or runtime errors.

Scientify is a cloud computer with research software installed and AI agents such as Codex and Claude Code built in. Describe what you need in one sentence, for example "align these FASTQ files to this reference genome, sort and index the BAM files, and report alignment rates", and the agent uses the preinstalled samtools to do the modeling and computation, with no software to install and no code to write.

Compared with installing more on your own computer, the cloud computer already has samtools, bcftools and htslib 1.24, plus bwa, bowtie2, minimap2, FastQC and other common tools, ready to use, and runs continue after you close your laptop.

The cloud computer comes with more computing power: CPU and GPU clusters can be called on demand for large-scale scientific computing. Compute is billed by the minutes you actually use, so nothing is wasted.

Cloud computer
4 vCPU · 8 GB
Top configuration, for data processing and small to medium jobs
Callable GPU
96 GB VRAM
Up to an RTX PRO 6000 per GPU; H800 80 GB and up to 8 × A10G also available
Callable CPU
224 cores · 3 TB
Largest spec, for large parallel computations

References

Frequently asked questions

Can samtools be installed on Windows?

Not directly with conda. Install WSL2 and install samtools with conda inside its Linux environment.

Why does it say libcrypto.so.1.0.0 is missing?

Usually the conda channel order is wrong and you got a samtools that depends on an old OpenSSL. Put conda-forge before bioconda, set strict priority and reinstall.

Which packages does a samtools source build need?

On Debian or Ubuntu: zlib1g-dev, libbz2-dev, liblzma-dev, libcurl4-openssl-dev, libssl-dev and libncurses5-dev, plus build tools such as gcc and make.

Analyze sequencing data with Scientify without setup

Upload your data, describe the computation, and Scientify runs it on a cloud computer that is already set up. New accounts get a free cloud computer and US$5 in credit.