重置conda通道优先级

EB8*_*B88 14 channel anaconda conda

我遇到了conda的问题.运行以下命令后:

conda install -c /my_conda_channel numpy --offline --override-channels
Run Code Online (Sandbox Code Playgroud)

默认的conda通道现在变为'my_conda_channel',以便来自此通道的每个后续包取代默认通道,这不是我想要的.我只是出于测试目的而做了前者.

如何重置频道行为?

Moh*_*ani 20

更改顺序,~/.condarc使defaults第一个通道为

channels:
  - defaults
  - conda-forge
Run Code Online (Sandbox Code Playgroud)

并将此行添加到它

channel_priority: true
Run Code Online (Sandbox Code Playgroud)

或者在命令行中运行以下代码

conda config --set channel_priority true
Run Code Online (Sandbox Code Playgroud)

然后又跑了

conda update --all
Run Code Online (Sandbox Code Playgroud)

祝好运

  • 从 conda `4.6.0` 开始,`channel_priority` 接受 `strict`、`flexible` 和 `disabled` 值。> 在 conda 的早期版本中,此参数配置为“True”或“False”。“True”现在是“flexible”的别名。请参阅 https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html 或 `conda config --describe channel_priority`。 (2认同)

Gol*_*Jer 5

另一种选择是将您的频道移至优先级列表的底部。
运行命令....

conda config --append channels my_conda_channel
Run Code Online (Sandbox Code Playgroud)

你应该得到这样的回应......

Warning: 'my_conda_channel' already in 'channels' list, moving to the bottom
Run Code Online (Sandbox Code Playgroud)

核实...

conda config --get channels
Run Code Online (Sandbox Code Playgroud)

这应该给你类似的东西......

--add channels 'defaults'   # highest priority
--add channels 'my_conda_channel'   # lowest priority
Run Code Online (Sandbox Code Playgroud)