conda list doesnt show channel name

Viewed 46

The conda list is not displaying the channel from which a package was installed it is blank. How to figure out from which channel the installed package came.

# conda list pyhive
# packages in environment at /data/opt/anaconda3:
# Name                    Version                   Build  Channel
pyhive                    0.6.1            py39h06a4308_0
1 Answers

defaults Channel Packages

That is how packages installed from defaults meta-channel appear. It is effectively the same as an explicit anaconda or main channel.

Options

There are a few options to get more information.

I will use the following example environment to showcase the behavior.

Example Environment

$ conda create -n foo -c defaults yaml
# ...
$ conda list -n foo
# packages in environment at /Users/mfansler/miniconda3/envs/foo:
#
# Name                    Version                   Build  Channel
yaml                      0.2.5                haf1e3a3_0  

show_channel_urls

The Conda config setting show_channel_urls affects how channels are displayed, and in the context of conda list controls whether defaults will be explicitly be shown or not.

This can be set temporarily, with the --show-channel-urls argument:

$ conda list -n foo --show-channel-urls
# packages in environment at /Users/mfansler/miniconda3/envs/foo:
#
# Name                    Version                   Build  Channel
yaml                      0.2.5                haf1e3a3_0    defaults

Alternatively, this can be persistently enabled by setting the configuration variable:

$ conda config --set show_channel_urls true
## now it shows the channel by default
$ conda list -n foo
# packages in environment at /Users/mfansler/miniconda3/envs/foo:
#
# Name                    Version                   Build  Channel
yaml                      0.2.5                haf1e3a3_0    defaults

Other arguments

There are two other useful arguments to obtain more specific information on the package origin, namely,

--canonical

conda list -n foo --canonical
defaults/osx-64::yaml-0.2.5-haf1e3a3_0

which shows both the meta-channel "defaults" and the subdir "osx-64".

--explicit

conda list -n foo --explicit 
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-64
@EXPLICIT
https://repo.anaconda.com/pkgs/main/osx-64/yaml-0.2.5-haf1e3a3_0.conda

This is the most informative format, since it actually specifies the full URL, which includes the real channel of origin, "main" - one of the channels within the defaults metachannel.

Related