Managing conda environment – Frequently used commands

Managing your conda environment is not difficult and also not easy to remember all the commands for it. You will eventually learn this commands by heart once you use them more often. So I thought of listing all most commonly used commands at one place.

Mostly used commands

Managing Conda and Anaconda

conda infoVerify conda is installed, check version #
conda update condaUpdate conda package and environment manager
conda update anacondaUpdate the anaconda meta package

Managing Environments

conda info --envsconda info -eGet a list of all my environmentsActive environment shown with *
conda create --name snowflakes biopythonconda create -n snowflakes biopythonCreate an environment and install program(s)
conda activate snowflakesActivate the new environment to use it
conda deactivateDeactivate the environment
conda create -n bunnies python=3.4 astroidCreate a new environment, specify Python version
conda create -n flowers --clone snowflakesMake exact copy of an environment
conda remove -n flowers --allDelete an environment
conda env export > puppies.ymlSave current environment to a file
conda env create -f puppies.ymlLoad environment from a file

Managing Python

conda search --full-name pythonconda search -f pythonCheck versions of Python available to install
conda create -n snakes python=3.4Install different version of Python in new environment

Managing .condarc Configuration

conda config --getGet all keys and values from my .condarc file
conda config --get channelsGet value of the key channels from .condarc file
conda config --add channels pandasAdd a new value to channels so conda looks for packages in this location

Managing Packages, Including Python

conda listView list of packages and versions installed in active environment
conda search beautiful-soupSearch for a package to see if it is available to conda install
conda install -n bunnies beautiful-soupInstall a new packageNOTE: If you do not include the name of the environment, it will install in the current active environment.
conda update beautiful-soupUpdate a package in the current environment
conda search --override-channels -c pandas bottleneckSearch for a package in a specific location (the pandas channel on
conda install -c pandas bottleneckInstall a package from a specific channel
conda search --override-channels -c defaults beautiful-soupSearch for a package to see if it is available from the Anaconda repository
conda install iopro accelerateInstall commercial Continuum packages
conda skeleton pypi pyinstrumentconda build pyinstrumentBuild a Conda package from a Python Package Index (PyPi) Package

Removing Packages or Environments

conda remove --name bunnies beautiful-soupRemove one package from any named environment
conda remove beautiful-soupRemove one package from the active environment
conda remove --name bunnies beautiful-soup astroidRemove multiple packages from any environment
conda remove --name snakes --allRemove an environment