What is a channel?
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. ExamplesURL | https://anaconda.org/conda-forge |
Name | conda-forge |
File Path | file:///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: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:
.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.
.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.
.condarc
) or by deleting the defaults
channel entirely.
- Open your
.condarc
file. - Add the following lines to the bottom of the file:
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
.condarc
file or by using conda commands in your Anaconda Prompt (Terminal for macOS/Linux).
Keep channel priority in mind when configuring your channels.
-
Open your
.condarc
file. -
Add your channel name or URL to the
channels:
list. For example, if you want to add conda-forge to your channels list below thedefaults
channel, yourchannels:
list would look like the following:
Channel priority
Conda searches for requested packages starting with the first entry in thechannels:
list in your .condarc
file. If the requested package is not located in that channel, conda continues searching using the next entry in the channels:
list.
When conda reaches the defaults
entry in the channels:
list, it searches the channels listed under the default_channels:
list, in the same descending order. This is called “channel priority”, and it determines which source conda uses first when resolving packages.
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.
—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.--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 asconda 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 required 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.