Conda Cheat Sheet

Conda is a popular open-source package management system and environment management system for installing and managing packages and their dependencies in various programming languages such as Python, R, and others. It is a cross-platform tool that makes package management and environment creation easy and consistent across different platforms.

Conda allows you to create and manage isolated virtual environments, each with its own set of packages and dependencies. This makes it easier to manage different projects and their dependencies, ensuring that each project has its own isolated environment with specific dependencies installed.

In addition, Conda supports multiple package sources or “channels”, allowing you to choose the best source for your packages depending on your specific needs. Conda also provides tools for exporting and importing environments, making it easy to share environments across different machines or with other users.

If you’re new to Conda or need a quick reference for its commands, this comprehensive cheat sheet can help. It covers everything from installation and setup to package management, environment management, channels, and miscellaneous commands. The cheat sheet is organized by theme, making it easy to find the commands you need quickly.

Cheat Sheet

Installation and Setup

CommandDescription
conda install <package>Install a package
conda create –name <env_name> <package>Create a new environment
conda activate <env_name>Activate an environment
conda deactivateDeactivate the current environment
conda env listList all environments
conda remove –name <env_name> –allRemove an environment
conda update condaUpdate Conda
conda update –allUpdate all packages

Package Management

CommandDescription
conda search <package>Search for a package
conda listList all installed packages
conda install <package>=<version>Install a specific version of a package
conda update <package>Update a package
conda remove <package>Remove a package

Environment Management

CommandDescription
conda create –name <env_name> <package>Create a new environment
conda env listList all environments
conda activate <env_name>Activate an environment
conda deactivateDeactivate the current environment
conda remove –name <env_name> –allRemove an environment
conda env export > environment.ymlExport an environment to a YAML file
conda env create -f environment.ymlCreate an environment from a YAML file

Channels

CommandDescription
conda config –add channels <channel>Add a channel
conda config –remove channels <channel>Remove a channel
conda config –show channelsShow all channels
conda install <channel>::<package>Install a package from a specific channel

Miscellaneous

CommandDescription
conda infoShow information about the current installation of Conda
conda clean –allRemove all unused packages and caches
conda config –set auto_activate_base true/falseSet whether the base environment should be activated by default

Reference:

https://docs.conda.io/en/latest/