0

I had installed Samtools using Conda environment. My MacBook is Apple Silicon M1 based. Recently I did system update and now it is macOS Monterey 12.4. Now Samtools is showing following error.

dyld[29136]: Library not loaded: @rpath/libcrypto.1.0.0.dylib
  Referenced from: /Users/atnik/opt/anaconda3/bin/samtools
  Reason: tried: '/Users/atnik/opt/anaconda3/bin/../lib/libcrypto.1.0.0.dylib' (no such file), '/Users/atnik/opt/anaconda3/bin/../lib/libcrypto.1.0.0.dylib' (no such file), '/usr/local/lib/libcrypto.1.0.0.dylib' (no such file), '/usr/lib/libcrypto.1.0.0.dylib' (no such file)
zsh: abort      samtools

It seems it is trying to look for "libcrypto.1.0.0.dylib" file in the library. I checked the library where I could see "libcrypto.1.1.dylib" but not the "libcrypto.1.0.0.dylib". I reinstalled Anaconda and Samtools but getting same error. The version of samtools installed is samtools-1.4.1-0. I tried to install the recent version (like 1.9 or 1.11) but not able to do so.

Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
Atsathe
  • 1
  • 2

1 Answers1

1

You really shouldn't be using Bioconda packages in an Anaconda base environment, because Bioconda requires the conda-forge channel to have highest priority, but Anaconda base starts with anaconda channel prioritized and it is extremely frustrating (e.g., slow solving) to change that. I'm really not sure why this was working previously.

Note that if you are installing Anaconda primarily for use of Bioconda, then maybe reconsider installing a Miniforge variant. I know very few bioinformaticians who actually need a full Anaconda installation - they really just want Conda environment and package management, which at the moment is best done using Mamba. Hence, I usually recommend Mambaforge for fresh installs.

Recommendation: Stop using Anaconda base

I'd recommend to stop using the base for installation of Bioconda packages. Instead, create a new environment, e.g.,

## create and activate a new environment (name it whatever)
conda create -n bio
conda activate bio

## configure channels
## See: https://bioconda.github.io/user/install.html#set-up-channels
conda config --env --add channels defaults
conda config --env --add channels bioconda
conda config --env --add channels conda-forge

## install software
conda install samtools

Always activate the environment before installing new packages, otherwise the channels configuration will not be set.


Alternative fix

If for some reason you don't want to follow my recommendation, your samtools installed in the base environment can likely be fixed by reinstalling openssl (which is what provides libcrypto.dylib) from conda-forge:

conda install conda-forge::openssl

However, this may lead to missing symbol issues in the Anaconda packages.

merv
  • 67,214
  • 13
  • 180
  • 245