问题
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:
- The default channels might change on newer version of
conda. For example, since conda 4.7, thefreechannel has been removed from the default channels. Another example is the addition of channelmainin conda 4.3.27. - 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.
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/57779829/command-to-display-active-conda-channels