python - 我可以将 channel 添加到特定的 conda 环境吗?

标签 python environment conda

我想将 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/

相关文章:

python - Python 存在哪些 SOAP 客户端库,它们的文档在哪里?

r - 在函数中使用 "env"对 data.table 进行编程

r - 了解 R 中的变量作用域

conda - 在单一容器中将conda环境容器化

r - 维护不同版本的R包以进行开源贡献

python - 如何指定conda需求文件?

python - 使用 python 和 lxml 忽略 xml 中的 unicode?

python - yield 如何在 Python C 代码中工作,好的和坏的部分

php - mysqli_fetch_assoc()需要参数/调用成员函数bind_param()错误。如何获取并修复实际的mysql错误?

python - 这个 "if"语句是什么意思?