Anaconda cheat sheet

What is Anaconda?

Anaconda is a Python distribution that allows you to create virtual environments so that you can isolate specific Python packages.

A virtual environment is a named, isolated, working copy of Python that that maintains its own files, directories, and paths so that you can work with specific versions of libraries or Python itself without affecting other Python projects. Virtual environments make it easy to cleanly separate different projects and avoid problems with different dependencies and version requirements across components.

Cheat sheet

Create environment

conda create -n myenv
conda create -n myenv python=3.6  # with a specific python version
conda create -n myenv scipy       # with a specific python package
conda env create -f environment.yml   # from a .yml file

List environments

conda env list

Activate environment

conda activate myenv

Deactivate environment

conda deactivate

View a list of the packages in an environment

conda list
conda list -n myenv

Export a .yml environment file

conda env export > environment.yml

Remove an environment

conda env remove --name myenv

Check conda version

conda info

Update conda

conda update conda

Please see the official page for more information.

Leave a Reply