A channel is a location where conda can search for packages to install in environments on your machine. Conda finds these channels via URL, name, or file path, depending on your setup.

Examples

URLhttps://conda.anaconda.org/conda-forge
Nameconda-forge
File Pathfile:///local-dev-channels/my-channel

Viewing your channels

To see which channels conda is currently configured to use, open Anaconda Prompt (Terminal on macOS/Linux) and run the following command:

conda config --show channels

Example return:

channels:
  - defaults
  - conda-forge

To manage the channels: list in your .conadrc file, see Managing channel configuration.

Opening your .condarc file

To locate your .condarc file, open Anaconda Prompt (Terminal on macOS/Linux) and run the following command:

conda config --show-sources

Example return:

==> /Users/<USERNAME>/miniconda3/.condarc <==
channels:
  - defaults

While the .condarc is most likely in your Home directory, it is a hidden file on MacOS and Linux and is not visible in file browsers under under normal circumstances.

You can view hidden files and folders using the following guidance for your operating system:

To view hidden files on macOS, use Shift+Cmd+. in your Finder.

For more information on the .condarc file, see Using the .condarc conda configuration file in the official conda documentation.

Managing the default channels

When you first install conda via the Anaconda Distribution or Miniconda installers, it comes configured to use a set of default channels:

  • https://repo.anaconda.com/pkgs/main
  • https://repo.anaconda.com/pkgs/r
  • https://repo.anaconda.com/pkgs/msys2 (Windows only)

These default channels are built and hosted by Anaconda and are subject to Anaconda’s Terms of Service.

The default channels shipped with Anaconda Distribution and Miniconda can be changed or removed, if necessary, by editing your conda configuration file (.condarc) or by deleting the defaults channel entirely.

  1. Open your .condarc file.
  2. Add the following lines to the bottom of the file:
default_channels:
  - Channel URL 1
  - Channel URL 2

Adding channel URLs to the default_channels: list overwrites the channels hardcoded into defaults.

Managing channel configuration

You might need packages that aren’t available in the default channels provided to you by your Anaconda Distribution or Miniconda installer. Some popular additional channels include:

  • conda-forge: A community-maintained channel with a vast collection of packages
  • bioconda: A community-maintained channel for specialized bioinformatics packages

Channels can be configured by manually editing your .condarc file or by using conda commands in your Anaconda Prompt (Terminal for macOS/Linux).

Keep channel priority in mind when configuring your channels.

  1. Open your .condarc file.

  2. Add your channel name or URL to the channels: list.

    For example, if you want to add conda-forge to your channels list below the defaults channel, your channels: list would look like the following:

    channels:
      - defaults
      - conda-forge
    

Channel priority

Conda searches for requested packages in the channel listed at the top of the channels: list first. If that channel contains the requested package, it is downloaded from that channel.

If the requested package is not located in that channel, conda will search for the package in the next entry of the channels: list.

When conda reaches the defaults entry of the channels: list, it searches the channels listed under the default_channels: list, in the same descending order. This is called “channel priority”.

Installing packages from a specific channel

You can install packages from the channels listed in your .condarc with the simplest version of the conda create, conda install or conda update commands, but if you want to specify a specific channel, you can do so in two ways: using the channel::package syntax or using the --channel flag. These methods both install a package from the channel you specify, but do so in slightly different ways.

channel::package syntax

This syntax installs the package from the specified channel, but installs that package’s dependencies from the channels in your .condarc file, following channel priority order.

# Replace <CHANNEL> with the channel you want to install from
# Replace <PACKAGE> with the package you want to install
conda install <CHANNEL>::<PACKAGE> <CHANNEL>::<PACKAGE>

This is the recommended syntax for installing packages from a specific channel, as it is the least invasive to your environment.

—channel flag

This flag installs the package and the package’s dependencies from the specified channel. The channel you specify will temporarily be the top priority channel in your channels list. If any dependencies are not found in the specified channel, conda searches down the rest of your channels in priority order.

# Replace <CHANNEL> with the channel you want to install from
# Replace <PACKAGE> with the package you want to install
conda install --channel <CHANNEL> <PACKAGE> <PACKAGE>

Using the --channel flag is only recommended when creating temporary or test environments or if you are an expert conda user, as more packages might end up being installed or updated from the specified channel than intended.

If you find yourself using the --channel flag often, consider adding the specified channel to your channels list, so you can better control how conda gets packages.

Changing your channel alias

You can type out an entire URL when installing packages, such as conda install https://conda.anaconda.org::<PACKAGE>, but specifying a long and complex channel URL every time you want to install a package takes time and might lead to mistakes. To improve your experience and streamline your workflows, conda allows you to implement a channel alias.

Your channel alias is used to automatically complete the channel address when installing conda packages. Conda prepends the provided channel name with the channel alias to create the full channel URL it requires to locate packages. By default, your channel alias is https://conda.anaconda.org, which is the domain name for Anaconda.org.

For example, the conda-forge channel is hosted at anaconda.org/conda-forge. With the default channel alias in place, you can just type the channel name conda-forge when specifying the package, instead of the longer https://conda.anaconda.org/conda-forge.

Channel aliases can also be used to point to different hosting places, such as the premium repositories Anaconda offers through our paid tiers. For more information on the channel alias, see channel_alias: Set a channel alias in the official conda documentation.

For more information on creating channels within your own local computer files, see Creating custom channels in the official conda documentation.

Was this page helpful?