我想将 conda channel 添加到特定的 conda environment但是当我使用
conda config --add channels glotzer
该 channel 现在可以从我所有的 conda 环境中使用。除了从另一个环境测试安装之外,~/.condarc
文件还有以下内容:
channels:
- glotzer
- defaults
如何配置 conda 以使 channel 仅在特定环境中可用?
我确实在 channel documentation 中找到了对于 conda >= 4.1.0,将 channel 放在 ~/.condarc
的底部将防止添加的 channel 覆盖核心包集。
By default conda now prefers packages from a higher priority channel over any version from a lower priority channel. Therefore you can now safely put channels at the bottom of your channel list to provide additional packages that are not in the default channels, and still be confident that these channels will not override the core package set.
我希望这可以防止大多数问题,除非在一个环境中您确实希望通过 channel 添加的包覆盖核心包。
最佳答案
从 conda 4.2 开始,支持特定环境的 .condarc
文件,您可以编写:
conda config --env --add channels glotzer
将 channel 添加到事件环境的配置中。
[不确定是否在 4.2 中添加了 --env
标志。答案基于 conda 4.5.9]
关于python - 我可以将 channel 添加到特定的 conda 环境吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40616381/