Concepts

../_images/installing-with-conda.png

Installing with conda

Conda install

  • When you conda install a package that exists in a channel and has no dependencies, conda:
    • looks at your configured channels (in priority)
    • reaches out to the repodata associated with your channels/platform
    • parses repodata to search for the package
    • once the package is found, conda pulls it down and installs

Specifying channels

  • From the command line use --channel
$ conda install scipy --channel conda-forge

You may specify multiple channels by passing the argument multiple times:
$ conda install scipy --channel conda-forge --channel bioconda

Priority decreases from left to right - the first argument is higher priority than the second.
  • From the command line use --override-channels to only search the specified channel(s), rather than any channels configured in .condarc. This also ignores conda's default channels.
$ conda search scipy --channel file:/<path to>/local-channel --override-channels
  • In .condarc, use the key channels to see a list of channels for conda to search for packages.

Learn more about managing channels.

Conda directory structure

This section describes the conda system directory structure.

ROOT_DIR

The directory that Anaconda or Miniconda was installed into.

EXAMPLES:

/opt/Anaconda  #Linux
C:\Anaconda    #Windows

/pkgs

Also referred to as PKGS_DIR. This directory contains decompressed packages, ready to be linked in conda environments. Each package resides in a subdirectory corresponding to its canonical name.

/envs

The system location for additional conda environments to be created.

The following subdirectories comprise the default Anaconda environment:

/bin
/include
/lib
/share

Other conda environments usually contain the same subdirectories as the default environment.

Conda environments

A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected. You can easily activate or deactivate environments, which is how you switch between them. You can also share your environment with someone by giving them a copy of your environment.yaml file. For more information, see Managing environments.

Conda packages

A conda package is a compressed tarball file that contains system-level libraries, Python or other modules, executable programs and other components. Conda keeps track of the dependencies between packages and platforms.

Conda packages are downloaded from remote channels, which are URLs to directories containing conda packages. The conda command searches a default set of channels, and packages are automatically downloaded and updated from http://repo.continuum.io/pkgs/. You can modify what remote channels are automatically searched. You might want to do this to maintain a private or internal channel. For details, see Channel locations (channels). See also Managing packages.

The conda package format is identical across platforms and operating systems.

To install conda packages, in the terminal or an Anaconda Prompt, run:

conda install [packagename]

Note

Replace [packagename] with the desired package name.

A conda package includes a link to a tarball or bzipped tar archive, with the extension ".tar.bz2", which contains metadata under the info/ directory and a collection of files that are installed directly into an install prefix.

During the install process, files are extracted into the install prefix, except for files in the info/ directory. Installing the files of a conda package into an environment can be thought of as changing the directory to an environment, and then downloading and extracting the .zip file and its dependencies---all with the single conda install [packagename] command.