pgmank
pgmank

Reputation: 5819

Command to display active conda channels

Is there a command to display active conda channels?

I know I can search for the .condarc file to check for any added channels. However, there are two problems with this approach:

  1. The default channels might change on newer version of conda. For example, since conda 4.7, the free channel has been removed from the default channels. Another example is the addition of channel main in conda 4.3.27.
  2. No unified way to display channels (that is open file contents) in different OS.

Therefore, a command is necessary for viewing active conda channels. Does such a command exist? I have conducted a web search, but have I have not found something.

Upvotes: 56

Views: 101816

Answers (2)

merv
merv

Reputation: 76750

In addition to conda info, one can also query configuration info specifically with the conda config --show [key] command. For high-level channel names, one can use

conda config --show channels

which outputs what you'd see in the .condarc, i.e., just the names of the channels, no URLs. The URLs used in defaults can be queried separately,

conda config --show default_channels

which for me gives,

default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r

Upvotes: 76

pgmank
pgmank

Reputation: 5819

By executing:

conda info

It displays information about conda, including current channels. More specifically, it displays the URL of the channels. For example, the channels listed in a freshly installed conda environment using default conda settings in an Ubuntu 16.04 64bit OS are:

channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
               https://repo.anaconda.com/pkgs/main/noarch
               https://repo.anaconda.com/pkgs/r/linux-64
               https://repo.anaconda.com/pkgs/r/noarch

You can distinguish the channel name from the URLs. In the above example, the channels listed are main and r.

Upvotes: 13

Related Questions