This document is a comprehensive cheat sheet for using Conda, a package and environment management tool for Python. It includes commonly used commands for installing Conda, managing environments, handling packages, exporting/importing environments, and cleaning up. The document also provides an example workflow demonstrating the creation, activation, and removal of a Conda environment.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
13 views3 pages
Conda Commands
This document is a comprehensive cheat sheet for using Conda, a package and environment management tool for Python. It includes commonly used commands for installing Conda, managing environments, handling packages, exporting/importing environments, and cleaning up. The document also provides an example workflow demonstrating the creation, activation, and removal of a Conda environment.
| Command | Description | Example | |-------------------------------------------------|-------------------------------- -----------------|-------------------------------------------| | `conda config --show channels` | Show the list of configured channels | `$ conda config --show channels` | | `conda config --add channels CHANNEL_NAME` | Add a new channel | `$ conda config --add channels conda-forge`| | `conda config --remove channels CHANNEL_NAME` | Remove a channel | `$ conda config --remove channels conda-forge`|
---
### 10. **Environment Backup**
- **Create a backup of all environments:** ```bash $ conda list --explicit > spec-file.txt ``` - **Restore from the backup:** ```bash $ conda create --name ENV_NAME --file spec-file.txt ```
---
### Example Workflow
1. Create a new environment and install packages: ```bash conda create --name data_env numpy pandas matplotlib ``` 2. Activate the environment: ```bash conda activate data_env ``` 3. Install additional packages: ```bash conda install seaborn ``` 4. Export the environment: ```bash conda env export > data_env.yml ``` 5. Deactivate and remove the environment: ```bash conda deactivate conda remove --name data_env --all ```
This cheat sheet provides all key commands to work efficiently with Conda.