Skip to content
hero
Philippe Bordron

Activate a conda environment

How to list existing conda environments?

Existing environments can be listed with the following command:

module load devel/Miniforge/Miniforge3 # if not done alreadyconda env list

Example

conda env list# conda environments:# my-env /home/<username>/.conda/envs/my-env
...
base /usr/local/bioinfo/src/Miniforge/Miniforge3
PPanGGOLiN-v2.2.1_env /usr/local/bioinfo/src/Miniforge/Miniforge3/envs/PPanGGOLiN-v2.2.1_env
...
/work/project/<my-project>/envs/my-env

In this example, there are 4 kinds of environment:

  1. The environment my-env created by yourself. It is stored into /home/<username>/.conda/envs/my-env and was created with the option -n my-env.

  2. The conda base environment. It was created when installing conda on the cluster. You cannot modify it.

  3. An environment PPanGGOLiN-v2.2.1_env. It was created by GenoToul-Bioinfo in order to install PPanGGOLiN-v2.2.1_env. You cannot modify it.

  4. An environment without name stored into /work/project/<my-project>/my-env. It was created by using the option -p.

How to activate an environment?

source activate </path/to/my/env>

Replace </path/to/my/env> by the path to environment (or by its name if created with option -n)

Activation command

On the cluster, conda environment is activated using source activate <env> command instead of conda activate <env> command.

Example

We activate environment compare-align we created previously

# We check that no blastx is availablewhich blastx# Nothing appears; we activate the environment `compare-align`conda activate /work/project/my-project/envs/compare-align# blastx is now availablewhich blastx/work/project/my-project/envs/compare-align/bin/blastx