Conda channels 'default' vs 'defaults'

Viewed 378

In a conda environment.yml file, is there any difference between

channels:
  - default

and

channels:
  - defaults

or default and defaults are just synonyms?

Edit: from my observations so far, one shall use defaults (with s at the end), not sure why conda allows default, but it seems to have no effect - as if I haven't specified any channel at all.

1 Answers

Yes, you are correct that Conda should behave as though you haven't provided any channel at all. However, Conda isn't equating default to defaults.

With the exception of explicitly providing a URL in the channel specification list, Conda attempts to induce a URL from the string provided, namely

channels:
  - default

will induce

https://conda.anaconda.org/default

This is so that one can easily specify user channels on Anaconda Cloud. In this case, it tries to source from the user default. Such an account exists, but hosts no packages.1 Effectively, this YAML provides no channels with any packages.

So, why are any packages found?

This occurs because the conda env create command still includes configured channels. So, if you have defaults or conda-forge included in the configuration settings (e.g., in ~/.condarc), Conda will also search for packages in those channels.2 Hence, we get the behavior that it acts as though one omitted the channels: section altogether.


[1]: That, unfortunately, would make for a dangerous typosquat.
[2]: There isn't actually a simple way to override the configured channels in the conda env commands (see Conda Issue).

Related