conda commands cheatsheet.
Create environments, install and update packages, and share your setup — the conda commands you use every day. Tap to copy.
conda create -n <env> python=3.11Create a new environment with a Python versionconda activate <env>Switch into an environmentconda deactivateLeave the current environmentconda env listList all environmentsconda remove -n <env> --allDelete an environment and its packagesconda install <pkg>Install a package into the active environmentconda install <pkg>=1.2.3Install a specific version of a packageconda update <pkg>Update a single packageconda update --allUpdate all packages in the environmentconda remove <pkg>Uninstall a packageconda listList installed packages in the environmentconda search <pkg>Search for available packages and versionsconda install -c conda-forge <pkg>Install a package from the conda-forge channelconda config --add channels conda-forgeAdd conda-forge as a default channelconda env export > environment.ymlExport the environment to a YAML fileconda env create -f environment.ymlRecreate an environment from a YAML fileconda list --explicitExport an exact package spec for reproducible buildsconda infoShow conda configuration and system detailsconda clean --allRemove unused packages, caches and tarballsconda update condaUpdate conda itselfconda --versionPrint the installed conda versionWhat 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.