Creating the Conda environment for CodeRefinery workshops

Prerequisite: installing conda from the Miniconda page.

  1. Open your terminal shell (e.g. Bash)

  2. If you have not, activate conda in Miniconda first using conda activate or source ~/miniconda3/bin/activate. If neither works, please first follow Setting path to Conda from your terminal shell. You probably need to restart your shell terminal. Then try conda activate or source ~/miniconda3/bin/activate again.

  3. Run the following command:

    $ conda env create -f
  4. Make sure that you see “coderefinery” in the output when you ask for a list of all available environments:

    $ conda env list

Activating the coderefinery environment

In the workshop, we will ask you to activate this environment.

First, follow the steps 1 and 2 in the above section (i.e. open your terminal shell and activate conda). Then run the following:

$ conda activate coderefinery

Or you can use

$ source activate coderefinery

as well. Please note however that conda activate is preferred command since conda ver. 4.4 Reference: conda Release notes, 4.4.0 (2017-12-20), New feature highlights, “conda activate”

If this does not work, the coderefinery part should be replaced with the whole path, for example:

$ source activate ~/Miniconda3/envs/coderefinery

How to verify the environment

Once activated, try the following 5 commands. You should see versions printed and not see errors (exact version numbers are not too important):

$ python --version

Python 3.11.0
$ jupyter-lab --version

$ pytest --version

$ sphinx-build --version

sphinx-build 5.3.0
$ snakemake --version


Deactivating the coderefinery environment

$ conda deactivate

Deleting the coderefinery environment

If you don’t need the coderefinery environment anymore, it is best to delete it. The following command will delete the whole environment:

$ conda remove --name coderefinery --all

In case you have both Anaconda3 and Miniconda3, check from which base environment the coderefinery environment was created, and first activate the corresponding base environment for the above command to work.