gpt4 book ai didi

anaconda - 是否可以将 conda 配置指定到环境文件中?

转载 作者:行者123 更新时间:2023-12-04 10:12:49 25 4
gpt4 key购买 nike

我使用 environment files创建新的 conda 环境。

不幸的是,我当前的项目依赖于 free channel ,已从较新版本的 anaconda 的默认 channel 中删除。它可以通过调用启用

    conda config --set restore_free_channel true
# More generally, a config is set by:
# conda config --set <key> <value>

这会修改用户的 ~/.condarc。由于这可能有副作用,我想将此配置添加到环境文件中,而不是全局设置 conda 配置。这可能吗?如果是,怎么办?

最佳答案

我能够像添加任何其他 channel 一样添加 free channel ,而无需更改我的配置:

name: test-env
channels:
- free
- defaults
dependencies:
- python=2.*
- beautiful-soup

conda list -n test-env 的输出:

# packages in environment at ****/opt/miniconda3/envs/test-env:
#
# Name Version Build Channel
beautiful-soup 4.3.2 py27_0 free
certifi 2016.2.28 py27_0 free
openssl 1.0.2l 0 free
pip 9.0.1 py27_1 free
python 2.7.13 0 free
readline 6.2 2 free
setuptools 36.4.0 py27_1 free
sqlite 3.13.0 0 free
tk 8.5.18 0 free
wheel 0.29.0 py27_0 free
zlib 1.2.11 0 free

为特定包指定 channel 也有效:

name: test-env
channels:
- defaults
dependencies:
- python=2.*
- free::beautiful-soup

conda list -n test-env 的输出:

# packages in environment at ****/opt/miniconda3/envs/test-env:
#
# Name Version Build Channel
beautiful-soup 4.3.2 py27_0 free
ca-certificates 2020.1.1 0
certifi 2019.11.28 py27_0
libcxx 4.0.1 hcfea43d_1
libcxxabi 4.0.1 hcfea43d_1
libedit 3.1.20181209 hb402a30_0
libffi 3.2.1 h475c297_4
ncurses 6.2 h0a44026_0
pip 19.3.1 py27_0
python 2.7.17 h97142e2_0
readline 7.0 h1de35cc_5
setuptools 44.0.0 py27_0
sqlite 3.31.1 ha441bb4_0
tk 8.6.8 ha441bb4_0
wheel 0.33.6 py27_0
zlib 1.2.11 h1de35cc_3

关于anaconda - 是否可以将 conda 配置指定到环境文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61239956/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com