Conda cheat sheet
Some definitions
Conda is an open source package manager tool and environment management system. It is mostly used for created isolated Python environments but it can package and distribute software for any language.
Anaconda is a free and open-source Python distribution for scientific computing. It includes conda and plus hundreds of popular Python packages such as numpy, scipy, matplotlib, pandas, etc…
Miniconda is a lighter alternative to Anaconda that just include conda and its dependencies but no Python packages.
A virtual environment is a named, isolated, working copy of Python that that maintains its own files, directories, and paths so that you can work with specific versions of libraries or Python itself without affecting other Python projects. Virtual environments make it easy to cleanly separate different projects and avoid problems with different dependencies and version requirements across components.
Please see the official page for more information.
You can download the official Conda cheat sheet here.
Other environment managers
virtualenv is a tool to create isolated environments for Python only.
venv is a tool to create isolated environments for Python 3 only.
Cheat sheet
- Create environment
conda create -n myenv
conda create -n myenv python=3.6 # with a specific python version
conda create -n myenv scipy # with a specific python package
conda env create -f environment.yml # from a .yml file
- List environments
conda env list
- Activate environment
conda activate myenv
- Deactivate environment
conda deactivate
- View a list of the packages in an environment
conda list
conda list -n myenv
- Export a YML environment file
conda env export > environment.yml
- Remove an environment
conda env remove --name myenv
- Check conda version
conda info
- Update conda
conda update conda
Leave a comment