Cheatsheet#

The conda cheatsheet contains the most important information about using conda, such as basic commands for creating and managing environments, installing packages, and importing and exporting environments.

See the conda cheatsheet PDF (3 MB) for a downloadable, single-page version.

Versions

Quickstart#

Tip

It is recommended to create a new environment for any new project or workflow.

verify conda install and check version

conda info

update conda in base environment

conda update --name base conda

install latest anaconda distribution (see release notes)

conda install anaconda

create a new environment (tip: name environment descriptively)

conda create --name ENVNAME

activate environment (do this before installing packages)

conda activate ENVNAME

Channels and Packages#

Tip

Package dependencies and platform specifics are automatically resolved when using conda.

Working with Conda Environments#

Tip

List environments at the beginning of your session. Environments with an asterisk are active.

list all environments and locations

conda info --envs

list all packages + source channels

conda list --name ENVNAME --show-channel-urls

install packages in environment

conda install --name ENVNAME PKGNAME1 PKGNAME2

remove package from environment

conda uninstall --name ENVNAME PKGNAME

update all packages in environment

conda update --all --name ENVNAME

Environment Management#

Tip

Specifying the environment name confines conda commands to that environment.

create environment with Python version

conda create --name ENVNAME python=3.10

clone environment

conda create --clone ENVNAME --name NEWENV

rename environment

conda rename --name ENVNAME NEWENVNAME

delete environment by name

conda remove --name ENVNAME --all

list revisions made to environment

conda list --name ENVNAME --revisions

restore environment to a revision

conda install --name ENVNAME --revision NUMBER

uninstall package from specific channel

conda remove --name ENVNAME --channel CHANNELNAME PKGNAME

Exporting Environments#

Tip

Name your export file after your environment to preserve your environment name.

cross-platform compatible

conda export --from-history>ENV.yml

platform + package specific

conda export ENVNAME>ENV.yml

platform + package + channel specific

conda list --explicit>ENV.txt

Importing Environments#

Tip

When importing an environment, conda resolves platform and package specifics.

from a .yml file

conda env create --name ENVNAME --file ENV.yml

from a .txt file

conda create --name ENVNAME --file ENV.txt

Additional Hints#

get help for any command

conda COMMAND --help

get info for any package

conda search PKGNAME --info

run commands w/o user prompt, e.g., installing multiple packages

conda COMMAND ARG --yes

conda install PKGNAME1 PKGNAME2 --yes

remove all unused files

conda clean --all

examine conda configuration

conda config --show