Conda is a powerful tool in the python ecosystem for package management & reproducible environment.
- create isolated environment for each project
- switching python versions easily
- install/update/remove packages safely
- export & recreate environment elsewhere
Mostly Used Commands
| Command | Goal |
conda info | shows system info/ installation location/ active environement and more.. |
conda update conda | updates conda to latest version |
conda install {{package_name}} | install package (conda install numpy) |
conda update {{package_name}} | update package(conda update scikit-learn) |
conda remove {{package_name}} | remove package (conda remove numpy) |
conda search {{package_name}} | search package (conda search numpy) |
conda env list | list environments |
conda create --name env01 python=3.5 | create environment |
conda create --clone env01 --name env02 | clone environment |
conda activate env01 | activate environment |
conda deactivate | deactivate current environment & activate the base environment |
conda env remove --name env02 | remove environment |
conda list --explicit > env01-env.txt | export environment |
conda env create --file env01-env.txt | recreate environment |
conda install --name env02 toolz | install into a specific environment (without activating it) |
conda install --channel conda-forge boltons | install from a specific channel |
pip install boltons | install packages using pip |
conda remove --name env02 toolz boltons | remove packages |
conda list --revisions | display numbered revisions of environment changes |
conda install --revision 2 | revert the environment to revision 2 |
Resource: conda-cheatsheet.pdf
