Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resetting conda channel priorities

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?

like image 215
EB88 Avatar asked Jan 31 '18 16:01

EB88


People also ask

What is conda defaults channel?

The conda command searches a set of channels. By default, packages are automatically downloaded and updated from the default channel https://repo.anaconda.com/pkgs/ which may require a paid license, as described in the repository terms of service a commercial license. The conda-forge channel is free for all to use.

Why is conda-forge so slow?

Unlike many package managers, Anaconda's repositories generally don't filter or remove old packages from the index. This allows old environments to be easily recreated. However, it does mean that the index metadata is always growing, and thus conda becomes slower as the number of packages increases.

Is conda-forge a default channel?

Miniforge is an effort to provide Miniconda-like installers, with the added feature that conda-forge is the default channel. Unlike Miniconda, these support ARMv8 64-bit (formally known as `aarch64`).


2 Answers

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
like image 59
Mohammad Hizzani Avatar answered Sep 21 '22 09:09

Mohammad Hizzani


Another option would be to move your channel to the bottom of the priority list.
Run the command....

conda config --append channels my_conda_channel 

You should get a response like this...

Warning: 'my_conda_channel' already in 'channels' list, moving to the bottom 

Verify...

conda config --get channels 

Which should give you something like...

--add channels 'defaults'   # highest priority --add channels 'my_conda_channel'   # lowest priority 
like image 45
GollyJer Avatar answered Sep 19 '22 09:09

GollyJer