For an introduction to channels, see What is a channel?
Viewing available channels
To see which channels conda is currently configured to use, open Anaconda Prompt (Terminal on macOS/Linux) and run the following command:Example return
Configuring channels
Conda reads its channel configuration from the.condarc file. To add, remove, or reorder channels, you’ll need to edit this file.
Locating your .condarc file
To locate your .condarc file, open Anaconda Prompt (Terminal on macOS/Linux) and run the following command:
Example return:
The
For more information on the
.condarc is a hidden file on macOS and Linux. View hidden files and folders using the following guidance for your operating system:- macOS
- Linux
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 channels
Channels can be added to and removed from yourchannels: list by using conda commands in Anaconda Prompt (Terminal on macOS/Linux) or by manually editing your .condarc file.
- Using the command line
- Editing manually
Use one of the following commands to add or remove a channel from your
channels: list:Replace <FLAG> with one of the command flags in the table below.
Replace <CHANNEL> with the channel you want to configure.
Replace <CHANNEL> with the channel you want to configure.
| Command flag | Description |
|---|---|
--add | Add a channel to the top of your channels: list. |
--prepend | Add a channel to the top of your channels: list. |
--append | Add a channel to the bottom of your channels: list. |
--remove | Remove a channel from your channels: list. |
Example
Configuring defaults
Thedefaults entry in your channels: list is a special alias.
When conda reaches the defaults channel in the channels: list, it searches the channels listed under default_channels: in descending order. If you haven’t configured any default_channels:, conda uses the hardcoded defaults that ship with Anaconda Distribution and Miniconda.
The default_channels: list can also be configured by using conda commands in Anaconda Prompt (Terminal on macOS/Linux) or by manually editing your .condarc file.
- Overwriting your default channels
- Removing the defaults channel
Adding any channel to the
default_channels: list overwrites the hardcoded defaults that ship with Anaconda Distribution and Miniconda.Replace <CHANNEL> with the URL of the channel you want to add.
Installing packages from a specific channel
When you runconda install, conda searches channels in your .condarc in priority order. To install a package from a specific channel, use either the double-colon syntax or the --channel flag. Both methods install a package from the channel you specify, but with different behaviors.
- Using the double-colon syntax
- Using the --channel flag
Using the double-colon 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.
Replace <PACKAGE> with the package you want to install.
Using a channel alias
A channel alias lets you refer to channels by name instead of their full URL. The default alias ishttps://conda.anaconda.org, so when you specify a channel like conda-forge by name in a conda command, conda automatically expands it to https://conda.anaconda.org/conda-forge.
For example, instead of having to run: