Conda Commands

conda commands cheatsheet.

Create environments, install and update packages, and share your setup — the conda commands you use every day. Tap to copy.

Environments
conda create -n <env> python=3.11Create a new environment with a Python version
conda activate <env>Switch into an environment
conda deactivateLeave the current environment
conda env listList all environments
conda remove -n <env> --allDelete an environment and its packages
Packages
conda install <pkg>Install a package into the active environment
conda install <pkg>=1.2.3Install a specific version of a package
conda update <pkg>Update a single package
conda update --allUpdate all packages in the environment
conda remove <pkg>Uninstall a package
conda listList installed packages in the environment
Channels & search
conda search <pkg>Search for available packages and versions
conda install -c conda-forge <pkg>Install a package from the conda-forge channel
conda config --add channels conda-forgeAdd conda-forge as a default channel
Export & share
conda env export > environment.ymlExport the environment to a YAML file
conda env create -f environment.ymlRecreate an environment from a YAML file
conda list --explicitExport an exact package spec for reproducible builds
Maintenance & info
conda infoShow conda configuration and system details
conda clean --allRemove unused packages, caches and tarballs
conda update condaUpdate conda itself
conda --versionPrint the installed conda version

What conda actually does

conda is a package and environment manager that ships with Anaconda and Miniconda. Unlike a pure Python tool, it's language-agnostic: it installs pre-built binaries — including compiled libraries and non-Python dependencies — so scientific stacks like NumPy, SciPy and PyTorch drop in without a compiler. Its other half is environments: isolated sandboxes that each hold their own Python version and packages, so one project's requirements never collide with another's. A typical day starts with conda activate <env> and ends with conda deactivate.

Working with environments

Create a fresh, named environment with conda create -n <env> python=3.11, pinning whatever Python version you need. Switch into it with conda activate <env>, and conda env list shows everything you've created. When a project is finished, conda remove -n <env> --all deletes the environment and every package in it. Keeping one environment per project is the habit that saves you from dependency headaches later.

Installing and channels

Inside an active environment, conda install <pkg> adds a package, and you can pin an exact build with conda install <pkg>=1.2.3. Packages come from channels, and the community-run conda-forge channel carries far more than the defaults — pull from it once with conda install -c conda-forge <pkg>, or add it permanently using conda config --add channels conda-forge. Use conda search <pkg> to see which versions are available before you commit.

Sharing and staying healthy

To make a project reproducible, conda env export > environment.yml records the exact packages and versions, and anyone can rebuild it with conda env create -f environment.yml. Over time conda clean --all reclaims disk space from old caches, and conda update conda keeps the tool itself current. These pair naturally with the pip commands for PyPI packages and the Python commands for running your code.

FAQ

What's the difference between conda and pip?
conda is a language-agnostic package and environment manager that installs pre-built binaries (including non-Python libraries) and manages isolated environments; pip installs Python packages from PyPI into whatever environment is active. You can use pip inside a conda environment, but it's best to install with conda first and only use pip for what conda can't provide.
How do I share a conda environment?
Run conda env export > environment.yml to capture the environment's packages and versions, commit that file, and let others recreate it with conda env create -f environment.yml.

More cheatsheets