我在使用 conda 时遇到问题。运行命令后,例如:
conda install -c /my_conda_channel numpy --offline --override-channels
默认的 conda channel 现在变成了“my_conda_channel”,因此该 channel 的每个后续包都会取代默认 channel ,这不是我想要的。我做前者只是为了测试目的。
如何重置 channel 行为?
最佳答案
从 ~/.condarc
更改订单以便 defaults
第一个 channel 作为
channels:
- defaults
- conda-forge
并将这一行添加到它
channel_priority: true
或在命令行中运行以下代码
conda config --set channel_priority true
然后再次运行
conda update --all
祝你好运
针对新版本的 conda 进行了编辑。根据 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'.
它仍然接受旧值
true
和 false
true
:= flexible
false
:= disabled
strict
:= 这是一个新值 关于anaconda - 重置 conda channel 优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48547046/