resetting conda channel priorities

EB88 picture EB88 · Jan 31, 2018 · Viewed 19.2k times · Source

I am having issues with conda. After running commands such as:

conda install -c /my_conda_channel numpy --offline --override-channels

the default conda channel has now become 'my_conda_channel' so that each subsequent package from this channel supercedes the default channel, which is not what I want. I did the former just for testing purposes.

How do I reset the channel behaviour?

Answer

Mohammad Hizzani picture Mohammad Hizzani · Jun 4, 2018

Change the order from ~/.condarc so that defaults the first channel as

channels:
  - defaults
  - conda-forge

and add this line to it

channel_priority: true

or run the following code in command-line

conda config --set channel_priority true

then again run

conda update --all

Good Luck


Edited for new versions of conda. According to conda doc

As of version 4.6.0, Conda has a strict channel priority feature. Strict channel priority can dramatically speed up conda operations and also reduce package incompatibility problems. We recommend it as a default. However, it may break old environment files, so we plan to delay making it conda's out-of-the-box default until the next major version bump, conda 5.0.

channel_priority (ChannelPriority)
Accepts values of 'strict', 'flexible', and 'disabled'.

It still accepts the old values true and false

  1. true := flexible
  2. false := disabled
  3. strict := this is a new value