A personal cheat sheet for Conda commands.


Other guidance

Quansights


Action Command Note
Create environment conda create --name <conda_env_name> python=3.8
Remove environment 1 conda deactivate
Remove environment 2 conda env remove --name <conda_env_name>
Remove packages from environment conda remove --name <conda_env_name> <package_name1> <package_name2>
Find available environments conda info --envs
Activate environment conda activate <conda_env_name>
Add packages to env from channel conda install --name <conda_env_name> --channel <channel_name> <package_name1> <package_name2>
Add packages active to env from channel conda install --name <conda_env_name> --channel <channel_name> <package_name1> <package_name2>
Add packages active to env via pip pip install <package_name1> <package_name2>
List packages in environment conda list --name <conda_env_name>
Update a package conda update <package_name>
Roll back environment conda list --revisions 1
Roll back environment conda install --revision <n> 2
Save env details to text file conda list --explicit > <conda_env_name>.txt
Update conda conda update -n base -c defaults conda

Notes


1. Lists revisions

2. Revert to revision number