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
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_basetofalse. - 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
Initialize conda in your shell
Initialize conda in your shell
If you recently installed Anaconda Distribution or Miniconda, make sure you closed and reopened your CLI to make conda’s initialization take effect.You can also initialize conda directly from its
bin directory:Replace <PATH_TO_CONDA> with a path to your conda installation.
Set auto_activate_base to true
Set auto_activate_base to true
To see the value for If your terminal returns If you have
auto_activate_base, run the following command: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: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.Use a shell that conda supports
Use a shell that conda supports
For information on which shells conda supports, see Conda activate in the official conda documentation.
Verify your installation of conda
Verify your installation of conda
If you have tried to initialize conda in your shell but it didn’t work, try uninstalling and reinstalling Anaconda Distribution or Miniconda.
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
Channels list adding extra channels
Cause
A
All
To see all theThis returns a list of
.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
defaultschannel
.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:.condarc file locations and their contents.Solution
There are a few ways you can solve this issue, depending on how you use your
If you continue to experience issues, please open a support ticket.
.condarc file:If you have write access to the installation directory .condarc file
If you have write access to the installation directory .condarc file
Add defaults to the installation directory .condarc file (Recommended)
Add defaults to the installation directory .condarc file (Recommended)
If you use
defaults to configure your channels, you should edit the installer root .condarc file to use defaults as well.-
Locate the installer root
.condarcfile usingconda config --show-sources. -
Add defaults to the installation directory
.condarcfile’schannels:list, then remove the hardcoded URLs. You can edit the files manually using your preferred text editor, or by using the following conda CLI command:Example commands
- Windows
- Linux/macOS
Delete the installation directory .condarc file
Delete the installation directory .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.-
Locate the installation directory
.condarcfile usingconda config --show-sources. -
Delete the installation directory
.condarcfile. This is a hidden file on macOS and Linux and is not visible in file browsers under normal circumstances.
If you do not have write access to the installation directory .condarc file
If you do not have write access to the installation directory .condarc file
If you do not want to use the This tells conda to ignore all channels in your
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-channelsflag with every conda command that installs or updates packages. - You must also specify at least one channel using the
--channel(or-c) flag.
.condarc files and only use the channels you explicitly specify to install or update packages and their dependencies.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: