snakemake: Conda activate not working on MacOS

Snakemake version

rm -rf .snakefile
conda create -c conda-forge -c bioconda -n snakemake snakemake --yes
conda activate snakemake
snakemake --version
# 5.3.0
conda --version
# conda 4.8.3

Describe the bug Snakemake is not finding conda on my computer, so that when I run snakemake --use-conda to execute my script, I see

Activating conda environment: /Users/james/Documents/Github/2020-sequential-adaptation/.snakemake/conda/f4707758
/bin/bash: activate: No such file or directory

from there it keeps running but runs into an error (because a package which is defined in the environment isn’t installed in my snakemake environment.

Additional context The only thing non-standard that I can think of is that I’m using zsh rather than bash for my shell. If I try conda activate .snakemake/conda/f4707758 it works and has the packages I want installed, so I know that Snakemake has successfully created this environment, but is struggling to activate it.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Hello, I have same issue on a Linux cluster: snakemake wants to load a conda environment with the command “source activate”, but this results in “/usr/bin/bash: activate: No such file or directory”. The environment itself as created by snakemake is fine, I can activate it manually and it has the dependencies. Just snakemake doesn’t seem to know about the conda version!? conda 4.8.2 snakemake 5.3.0 (installed inside a conda environment)

Same here on a different system:

  • Red Hat Enterprise Linux Server release 7.9 (Maipo)
  • conda 4.7.12 (no mamba)

Running conda install conda in conda env in which snakemake is installed solved the problem.

Having the same problem here on Ubuntu 18.04 LTS on an Amazon EC2 instance; tried the conda install conda trick mentioned by @madil7173 but to no avail, and I get the same results as @mscharmann when I try to activate the environment. I’m overall very confused…

Edit: Updating to snakemake 5.26.1 fixed my issue, sorry to have upped the thread for nothing !

Running conda install conda in conda env in which snakemake is installed worked for me too.

Hello, I have same issue on a Linux cluster: snakemake wants to load a conda environment with the command “source activate”, but this results in “/usr/bin/bash: activate: No such file or directory”. The environment itself as created by snakemake is fine, I can activate it manually and it has the dependencies. Just snakemake doesn’t seem to know about the conda version!? conda 4.8.2 snakemake 5.3.0 (installed inside a conda environment)