Conda

Aus Wiki
Zur Navigation springen Zur Suche springen

Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language.

Links

Useful commands

For full documentation of any command, type the command followed by --help.
E.g. conda create --help

Managing conda and anaconda

conda info Verify conda is installed, check version #
conda update conda Update conda package and environment manager to current version
conda update anaconda Update the anaconda meta package (the library of packages ready to install with conda command)

Managing environments

conda info --envs Get a list of all my environments, active environment shown with *
conda create --name snowflakes biopython Create an environment and install program(s)
source activate snowflakes (Linux, OS X)
activate snowflakes (Windows)
Activate the new environment to use it
conda create -n flowers --clone snowflakes Make exact copy of an environment
conda remove -n flowers --all Delete an environment
conda env export > puppies.yml Save current environment to a file. This is the preferred way as it includes pip-installed packages and the used channels as well.
conda env create -f puppies.yml Load environment from a file

Managing Python

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

Managing .condarc configuration

conda config --get Get all keys and values from my .condarc file
conda config --get channels Get value of the key channels from .condarc file
conda config --add channels pandas Add a new value to channels so conda looks for packages in this location
conda config --env --add channels conda-forge Add conda-forge as channel for the active environment, i.e. not to user's .condarc

Managing packages

conda list View list of packages and versions installed in active environment
conda list -r View list of packages with installation (revision) history (cf. conda install -r)
conda search beautiful-soup Search for a package to see if it is available to conda install
conda install -n bunnies beautiful-soup Install a new package (leave out -n option for installation in current active environment)
conda install -r <rev> beautiful-soup Install a specific revision of a package (cf. conda list -r)
conda update beautiful-soup Update a package in the current environment
conda search --override-channels -c pandas bottleneck Search for a package in a specific location
conda install -c pandas bottleneck Install a package from a specific channel
conda search --override-channels -c defaults beautiful-soup Search for a package to see if it is available from the Anaconda repository

Remove packages, or channels

conda remove --name bunnies beautiful-soup Remove one package from any named environment
conda remove beautiful-soup Remove one package from the active environment
conda remove --name bunnies beautiful-soup astroid Remove multiple packages from any environment