0% found this document useful (0 votes)
9 views

ChatGPT-Conda

This document is a comprehensive cheat sheet for commonly used Conda commands, including installation, environment management, package management, and more. It provides examples for each command to facilitate efficient use of Conda. Additionally, it includes steps for creating, activating, exporting, and removing environments.

Uploaded by

tharun.loverboy6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

ChatGPT-Conda

This document is a comprehensive cheat sheet for commonly used Conda commands, including installation, environment management, package management, and more. It provides examples for each command to facilitate efficient use of Conda. Additionally, it includes steps for creating, activating, exporting, and removing environments.

Uploaded by

tharun.loverboy6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Conda commands list

Conda is a powerful package management and environment management tool for


Python and other languages. Here’s a comprehensive list of commonly used Conda
commands along with examples:

1. Install Conda
Install Miniconda or Anaconda from their respective websites:

Miniconda: https://docs.conda.io/en/latest/miniconda.html

Anaconda: https://www.anaconda.com/products/distribution

2. Basic Information Commands

Command Description Example

`conda --version` Check Conda version `$ conda --version`

`conda info` Display general Conda information `$ conda info`

`conda list` List all installed packages `$ conda list`

3. Working with Environments

🚀 Powered by ChatGPT Exporter 1/5


Command Description Example

`conda create --name Create a new environment `$ conda create --name


ENV_NAME` my_env`

`conda create -n ENV_NAME Create environment with specific `$ conda create -n my_env
PKG_NAME` numpy pandas`
package(s)

`conda env list` List all environments `$ conda env list`

`conda activate ENV_NAME` Activate an environment `$ conda activate my_env`

`conda deactivate` Deactivate the current `$ conda deactivate`

environment

`conda remove --name Remove an environment `$ conda remove --name my_env


ENV_NAME --all` --all`

4. Managing Packages

Command Description Example

`conda install PKG_NAME` Install a package `$ conda install numpy`

`conda install Install a specific package `$ conda install numpy=1.21.0`


PKG_NAME=VERSION`
version

`conda install -c CHANNEL_NAME Install a package from a `$ conda install -c conda-forge


PKG_NAME` matplotlib`
specific channel

`conda update PKG_NAME` Update a package `$ conda update scipy`

`conda update conda` Update Conda `$ conda update conda`

`conda uninstall PKG_NAME` Uninstall a package `$ conda uninstall pandas`

🚀 Powered by ChatGPT Exporter 2/5


5. Cloning an Environment

Command Description Example

`conda create --name NEW_ENV -- Clone an existing `$ conda create --name new_env --
clone OLD_ENV` clone old_env`
environment

6. Exporting and Importing Environments

Command Description Example

`conda env export > Export current environment to a `$ conda env export >
env.yml` my_env.yml`
YAML file

`conda env create -f Create an environment from a YAML `$ conda env create -f
env.yml` my_env.yml`
file

7. Searching for Packages

Command Description Example

`conda search PKG_NAME` Search for a package `$ conda search matplotlib`

🚀 Powered by ChatGPT Exporter 3/5


8. Cleaning Up

Command Description Example

`conda clean --all` Remove unused packages and cache files `$ conda clean --all`

9. Working with Channels

Command Description Example

`conda config --show channels` Show the list of configured `$ conda config --show
channels`
channels

`conda config --add channels Add a new channel `$ conda config --add channels
CHANNEL_NAME` conda-forge`

`conda config --remove channels Remove a channel `$ conda config --remove


CHANNEL_NAME` channels conda-forge`

10. Environment Backup

Create a backup of all environments:

$ conda list --explicit > spec-file.txt

Restore from the backup:

$ conda create --name ENV_NAME --file spec-file.txt

🚀 Powered by ChatGPT Exporter 4/5


Example Workflow

1. Create a new environment and install packages:

conda create --name data_env numpy pandas matplotlib

2. Activate the environment:

conda activate data_env

3. Install additional packages:

conda install seaborn

4. Export the environment:

conda env export > data_env.yml

5. Deactivate and remove the environment:

conda deactivate
conda remove --name data_env --all

This cheat sheet provides all key commands to work efficiently with Conda. Let me
know if you need more details!

🚀 Powered by ChatGPT Exporter 5/5

You might also like