Conda - Environment

About

A conda environment is a directory that contains a specific collection of conda packages that you have installed.

Management

File Structure

The following subdirectories comprise the default Anaconda environment:

/bin
/include
/lib
/share

List

conda env list
# conda environments:
#
base                  *  C:\Anaconda2-Python2.7

Save

conda list --explicit > bio-env.txt

Remove

conda env remove --name bio-env

Create

Scratch

Create a new environment named envName, install Python 3.5

conda create --name envName python=3.5

Clone

conda create --clone envName --name envTargetName

Text file

  • From a text file created with the save command
conda env create --file env-name.txt

Activate

See Python - virtualenv (Python Environment)

  • WINDOWS:
activate
  • macOS, LINUX
source activate

Deactivate

See Python - virtualenv (Python Environment)

  • WINDOWS:
deactivate
  • macOS, LINUX
source deactivate

Share

Share a copy of the environment.yaml file.

Prompt

Doc

When using activate, change the command prompt from $PS1 to include the activated environment. The default is True.

changeps1: False

Revision

List changes

List the history of each change to the current environment

conda list --revisions

Restore

Restore environment to a previous revision

conda install --revision 2

Documentation / Reference


Powered by ComboStrap