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
Command | Description |
conda install <package> | Install a package |
conda create –name <env_name> <package> | Create a new environment |
conda activate <env_name> | Activate an environment |
conda deactivate | Deactivate the current environment |
conda env list | List all environments |
conda remove –name <env_name> –all | Remove an environment |
conda update conda | Update Conda |
conda update –all | Update all packages |
Package Management
Command | Description |
conda search <package> | Search for a package |
conda list | List 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
Command | Description |
conda create –name <env_name> <package> | Create a new environment |
conda env list | List all environments |
conda activate <env_name> | Activate an environment |
conda deactivate | Deactivate the current environment |
conda remove –name <env_name> –all | Remove an environment |
conda env export > environment.yml | Export an environment to a YAML file |
conda env create -f environment.yml | Create an environment from a YAML file |
Channels
Command | Description |
conda config –add channels <channel> | Add a channel |
conda config –remove channels <channel> | Remove a channel |
conda config –show channels | Show all channels |
conda install <channel>::<package> | Install a package from a specific channel |
Miscellaneous
Command | Description |
conda info | Show information about the current installation of Conda |
conda clean –all | Remove all unused packages and caches |
conda config –set auto_activate_base true/false | Set whether the base environment should be activated by default |
Reference: