# Conda

# Reproducible science

Conda is a great way to help you take control over your dependencies, and to avoid unwanted surprises over time. We recommend you to start with their guide on how to manage environments (opens new window).

# A safe place to experiment

Create your own environments for Python or R packages. Export the details into the environment file for reproducibility. Share environment files with others.

# Conda or Mamba

We install both. Generally they should be interchangeable. We recommend that you mamba instead of conda for create and install commands for quicker setup. If you have older setup without mamba command replace it with conda.

# Conda environments

Start by finding out which environments you already have:

conda env list

List packages installed in your environment. Replace "name" with a name of one of your environments from the list above.

# General example
conda list -n name

# Specific example with py310
conda env export -n py310

# Create a sharable environment

You can keep configuration of your environment in your git repository together with your code. In general example replace name with name of your environment:

# General example
conda env export -n name > environment.yml

# Specific example with py310
conda env export -n py310 > environment.yml

You or your lab mates can use this environment file to recreate same environment.

conda env create -f environment.yml
Last Updated: 4/25/2024