Conda environment and projects

A very important aspect of reproducible bioinformatics is to manage software, tools and environment properly. One interesting alternative for such difficult task is Conda.

As stated in Conda’s website: “Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux.” .

I have been using conda environments for different projects and for each project I have created individual environment. Here I will quickly show basic commands do create, export and import environments.

To create one conda environment in the directory conda:

conda create --prefix ./conda

After that you need to activate the environment:

conda activate ./conda

Now you can search, install, update and uninstall packages. To install pandas for example:

conda install pandas

To export conda environment into a yml file:

conda env export > env.yml

To create a conda environment based on yml file:

conda env create -f env.yml --prefix ./conda

When done working on a project, deactivate conda:

conda deactivate

Keeping conda environment export files can help you keep track and manage properly versions of packages you have used for a given project.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s