Skip to content

Using and Creating Anaconda Environments

Connie Gao edited this page Jan 26, 2016 · 1 revision

The purpose of the Anaconda platform is to be able to isolate and manage independent Python environments with differing sets of dependencies such that conflicts do not occur between different software programs. We use it with RMG to ensure that we use all the correct versions for our dependencies.

Creating any Anaconda environment

Use the following command in a terminal or command prompt:

conda create --name environment_name pkg_you_want_in_the_environment

Using an environment.yml file to set up a conda environment

In the case where you don't want to build a binary but want conda to create an environment with all the right dependencies, like what we recommend for RMG developers who want to compile the source code frequently, we use an environment.yml file. This file stores all the channels and places to look for those dependencies as well as the versions of the dependencies required. To create that environment you just need to type

conda env create

while in the pkg_name folder. The name of the environment will be specified in the environment.yml file itself.

Note that OS specific flags will be ignored here, unlike in the meta.yaml file for building binaries. That means if you need to remove a dependency for your OS, you have to delete that line! However, you could just create a OS specific environment with a different name like environment_windows.yml and use it like so

conda env create -f environment_windows.yml