Conda environment
A Conda environment is an isolated software environment that is used to manage dependencies for a project and you decide where it is located.
You will need a environment.yml
file that documents the dependencies:
name: coderefinery
channels:
- conda-forge
- bioconda
dependencies:
- python >= 3.10
- black
- click
- flit
- ipywidgets
- isort
- jupyterlab
- jupyterlab_code_formatter
- jupyterlab-git
- matplotlib
- myst-parser
- nbdime
- numpy
- pandas
- pytest
- pytest-cov
- scalene
- seaborn
- snakemake-minimal
- sphinx
- sphinx-autoapi
- sphinx-autobuild
- sphinx_rtd_theme >= 2.0
- vulture
- scikit-image
Before you create a virtual environment
Create a new directory for this course.
In this directory, create an
environment.yml
file and copy-paste the dependencies above into it.
Choose the tool to manage the environment
If you are already using one of these tools, please continue using the tool that you like and know. If you are new to this, we recommend using Miniconda or Miniforge.
-
Advantages: easy to install, easy to use, good for beginners
Disadvantages: large download, installs more than we will need, license restrictions
-
Advantages: small size, installs only what you need
Disadvantages: no graphical interface, license restrictions
-
Advantages: small size, no license restrictions
Disadvantages: no graphical interface
-
Advantages: fast, small size
Disadvantages: no graphical interface
-
Advantages: fast and new
Disadvantages: new and less tested and not documented here
Creating the virtual environment
Open your terminal shell (e.g. Bash or Zsh).
Activate
conda
usingconda activate
orsource ~/miniconda3/bin/activate
.Run the following command:
$ conda env create --file environment.yml
Make sure that you see “coderefinery” in the output when you ask for a list of all available environments:
$ conda env list