Skip to main content
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:
conda config --show channels
Example return
channels:
  - defaults
  - conda-forge

command not found: conda


Cause
The command not found: conda error occurs when your command line interface (CLI) can’t find the conda command in order to use it. This might be because:
  • You don’t have conda properly initialized.
  • You have set auto_activate_base to false.
  • You’re using a shell that conda doesn’t support.
  • Conda is not installed or the install was incomplete or corrupted.
These issues primarily occur on macOS/Linux computers. Anaconda Distribution and Miniconda installations on Windows include Anaconda Prompt, which opens with conda initialized by default.

Solution
If you recently installed Anaconda Distribution or Miniconda, make sure you closed and reopened your CLI to make conda’s initialization take effect.
If you don’t want to close your CLI, you can also use one of the following source commands to refresh your shell:
source ~/.bashrc
Use the command that matches your shell.
You can also initialize conda directly from its bin directory:
<PATH_TO_CONDA>/bin/conda init
Replace <PATH_TO_CONDA> with a path to your conda installation.
To see the value for auto_activate_base, run the following command:
conda config --describe auto_activate_base
If your terminal returns false, this means that conda is not automatically activating your base environment when you start a new shell. This behavior emulates your system Python, and some users prefer to have their conda environment be inactive until they need it. However, this is not conda’s default behavior after installation.To change the value of auto_activate_base to true, run the following command:
conda config --set auto_activate_base true
If you have auto_activate_base set as false, the conda command will still be available as a shell function, but your base environment will not be active when a new shell is started. To activate your base environment, run conda activate.
For information on which shells conda supports, see Conda activate in the official conda documentation.
If you have tried to initialize conda in your shell but it didn’t work, try uninstalling and reinstalling Anaconda Distribution or Miniconda.
Make sure that you say yes to the initialization option, and, if installing from the CLI, reinitialize your shell by restarting it or using its source command. For more information, see Initialize conda in your shell.

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:
conda config --show-sources
Example return:
==> /Users/<USERNAME>/miniconda3/.condarc <==
channels:
  - defaults
The .condarc is a hidden file on macOS and Linux. View hidden files and folders using the following guidance for your operating system:
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 your channels: list by using conda commands in Anaconda Prompt (Terminal on macOS/Linux) or by manually editing your .condarc file.
Keep channel priority in mind when configuring your channels.
Use one of the following commands to add or remove a channel from your channels: list:
conda config <FLAG> channels <CHANNEL>
Replace <FLAG> with one of the command flags in the table below.
Replace <CHANNEL> with the channel you want to configure.
Command flagDescription
--addAdd a channel to the top of your channels: list.
--prependAdd a channel to the top of your channels: list.
--appendAdd a channel to the bottom of your channels: list.
--removeRemove a channel from your channels: list.
Example
conda config --add channels conda-forge

Channels list adding extra channels


Cause
A .condarc file has been added to the root folder of your Anaconda Distribution and Miniconda installations. This file has a channels: list that contains either:
  • a list of hard-coded URLs
  • the defaults channel
When using channels, conda merges all of your computer’s .condarc files together in specific ways. For more information on how conda uses your .condarc files, see the Searching for .condarc section of the official conda documentation.

All channels: lists in your .condarc files are merged together when conda searches for packages. This causes the Anaconda default URLs to be appended to (added to the end of) your channels: list.

To see all the .condarc files influencing your currently active conda environment, run the following command:
conda config --show-sources
This returns a list of .condarc file locations and their contents.
Your installation directory .condarc file should be in the folder where you installed Anaconda Distribution or Miniconda, most likely similar to one of the following:
C:\Users\<USERNAME>\anaconda3
C:\Users\<USERNAME>\miniconda3
/Users/<USERNAME>/anaconda3
/Users/<USERNAME>/miniconda3
/opt/anaconda3
/opt/miniconda

Solution
There are a few ways you can solve this issue, depending on how you use your .condarc file:

If you have your channels configured in a different .condarc file (whether you use defaults or not), you can also delete the installation directory .condarc file.
Make sure that you always have at least one .condarc file with a channels: list defined. Conda requires this to function.
  1. Locate the installation directory .condarc file using conda config --show-sources.
  2. Delete the installation directory .condarc file. This is a hidden file on macOS and Linux and is not visible in file browsers under normal circumstances.
If you do not want to use the defaults channels and cannot edit or remove the installation directory .condarc file (for example, you installed on macOS using the graphical installer without sudo access):
  • You must use the --override-channels flag with every conda command that installs or updates packages.
  • You must also specify at least one channel using the --channel (or -c) flag.
Example:
conda install --override-channels --channel conda-forge numpy
This tells conda to ignore all channels in your .condarc files and only use the channels you explicitly specify to install or update packages and their dependencies.
If you continue to experience issues, please open a support ticket.

Configuring defaults

The defaults 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.
Adding any channel to the default_channels: list overwrites the hardcoded defaults that ship with Anaconda Distribution and Miniconda.
conda config --add default_channels <CHANNEL>
Replace <CHANNEL> with the URL of the channel you want to add.

Installing packages from a specific channel

When you run conda 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 installs the package from the specified channel, but installs that package’s dependencies from the channels in your .condarc file, following channel priority order.
conda install <CHANNEL>::<PACKAGE>
Replace <CHANNEL> with the channel you want to install from.
Replace <PACKAGE> with the package you want to install.
This is the recommended syntax for installing packages from a specific channel, as it is the least invasive to your environment.

Using a channel alias

A channel alias lets you refer to channels by name instead of their full URL. The default alias is https://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:
conda install --channel https://conda.anaconda.org/conda-forge numpy
You can run:
conda install --channel conda-forge numpy
You can configure the channel alias to point to a different location, such as an Anaconda Platform (Self-hosted) server. For more information about setting a channel alias, see channel_alias: Set a channel alias in the official conda documentation.