我希望能够定义应该安装在我所有 conda 环境中的标准包列表。例如,当我创建一个新环境时,我知道我将始终需要 jupyterlab、numpy、matplotlib、pandas ……如果我不必在我创建的每个新环境中安装它们,那就太好了。
无论如何,这是可能的吗?我在文档或互联网上的其他地方没有找到任何内容,但也许我错过了一些东西......
现在,当我创建一个新环境时,我必须手动指定该环境中我需要哪些包。所以每次我创建一个新环境时,我必须
conda install -c conda-forge jupyterlab numpy matplotlib pandas <and a bunch of other packages>
这很乏味,因为我需要很多包。
我目前在我的主目录中有一个 shell 脚本来完成这项工作,所以如果我创建一个新环境,我只需要运行这个脚本。但是,如果我能告诉 conda 在我所有的新环境中自动安装这些包,那就太好了。
#export the current environment to yml file (txt file)
conda env export > environment.yml
# this will create new environment with all packages same as previous environment
conda env create -f environment.yml
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句