Skip to main content

Conda Cheatsheet

A quick reference guide to the most commonly used Conda commands.


Setup and Configuration

CommandDescription
conda --versionCheck the installed Conda version.
conda infoDisplay general information about the Conda installation.
conda config --showView Conda configuration settings.
conda config --add channels conda-forgeAdd the conda-forge channel.
conda config --set channel_priority strictPrioritize specified channels strictly.
conda update condaUpdate Conda to the latest version.

Environment Management

CommandDescription
conda create --name myenvCreate a new environment with the default Python version.
conda create --name myenv python=3.11Create a new environment with a specific Python version.
conda activate myenvActivate an existing environment.
conda deactivateDeactivate the current environment.
conda env listList all available environments.
conda remove -n myenv --allRemove an environment and all its packages.

Package Management

CommandDescription
conda search <package>Search for a package available in Conda channels.
conda install <package>Install a package into the current environment.
conda install -c conda-forge <package>Install a package from the conda-forge channel.
conda update <package>Update a specific package.
conda update --allUpdate all packages in the current environment.
conda remove <package>Uninstall a package from the current environment.
conda listList all installed packages in the current environment.

Using pip Within Conda Environments

CommandDescription
conda install pipInstall pip inside a Conda environment.
pip install <package>Install a package from PyPI (inside a Conda environment).
pip listList pip-installed packages in the environment.

Exporting and Recreating Environments

CommandDescription
conda env export > environment.ymlExport the current environment to a YAML file.
conda env create -f environment.ymlCreate a new environment from a YAML file.
conda list --export > requirements.txtExport package list in a pip-style format.
conda install --file requirements.txtInstall packages from a requirements file.

Cleaning and Maintenance

CommandDescription
conda clean --all -yRemove cached packages, logs, and temporary files.
conda clean --packagesRemove unused or outdated packages.
conda clean --tarballsDelete cached package tarballs.
conda clean --index-cacheClear the local index cache.

Troubleshooting and Info Commands

CommandDescription
conda info --envsDisplay a list of environments with their locations.
conda info --packagesShow information about installed packages.
conda search --channel conda-forge <package>Search for a package within a specific channel.
conda doctorDiagnose common Conda environment issues (available in newer versions).
conda run -n myenv <command>Run a command inside an environment without activating it.

Best Practices

Command / TipDescription
Use conda-forge as your main channelProvides the most up-to-date community packages.
Always create a new environment per projectKeeps dependencies isolated and manageable.
Use conda install before pip installEnsures compatibility between compiled packages.
Regularly run conda update --allKeeps environments secure and current.
Use conda clean --all periodicallyFrees disk space and removes unused caches.

For more information and advanced usage, visit the official documentation: Conda Documentation | Conda-Forge