Conda Cheatsheet

Posted : admin On 1/2/2022
  1. Conda config -get Get all keys and values from my.condarc file conda config -get channels Get value of the key channels from.condarc file conda config -add channels pandas Add a new value to channels so conda looks for packages in this location Conda user cheat sheet For full documentation of any command, type the command followed by -help.
  2. Conda deactivate my-dev-env. Search for packages. Conda search searches whatever channels are configured (at least, that is the default channel) conda search -channel searches the package also in the specified channel. Conda config -add channels Update a Conda environment.
Conda Cheatsheet

If you’re not using conda regularly, it’s almost certain you forget how to use it from usage to usage. I’ve compiled a list of commands I use most often.

You can download the PDF or Google doc version (fits on one page!).

Conda remove -name snakes -all Remove an environment Conda user cheat sheet Managing packages, including Python conda list View list of packages and versions installed in active environment conda search beautiful-soup Search for a package to see if it is available to conda install conda install -n bunnies beautiful-soup Install a new package.

conda activate [env_name]
conda activate pytorch_py36
conda install [package_spec ...]
conda install numpy scikit-learn=0.23.1
Createfrom specific channel
conda create --name [env_name] [package_spec …]
conda create --name math_py36 python=3.6 numpy
conda install -c [channel] [package_spec …]
conda install -c conda-forge numpy
Create from fileUpdate package
conda create --file [path]
conda create --file exported_env.txt
conda update [package_spec …]
conda update numpy scikit-learn=0.23.1
Delete package
conda remove [package_name …]
conda remove numpy scikit-learn
* package_spec - package_name or package_name=package_version

Some definitions

Conda is an open source package manager tool and environment management system. It is mostly used for created isolated Python environments but it can package and distribute software for any language.

Anaconda is a free and open-source Python distribution for scientific computing. It includes conda and plus hundreds of popular Python packages such as numpy, scipy, matplotlib, pandas, etc…

Miniconda is a lighter alternative to Anaconda that just include conda and its dependencies but no 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.

Please see the official page for more information.

Other environment managers

virtualenv is a tool to create isolated environments for Python only.

venv is a tool to create isolated environments for Python 3 only.

Conda Check Env

Cheat sheet


Create environment


List environments

Activate environment

Deactivate environment

View a list of the packages in an environment

Export a .yml environment file

Remove an environment

Check conda version

Conda Create Environment Cheat Sheet

Update conda