将软件包安装到多个/所有conda环境中?

问题描述:

我正在使用conda来针对不同版本的python,numpy等运行测试,但是python / numpy的所有组合都有一些共同的依赖性。

I'm using conda to run tests against different versions of python, numpy, etc., but there are some common dependencies for all combinations of python/numpy. Is there a way to install such packages into all conda environments, or do I have to specify each by hand?

您可以在 conda env list 的输出上运行shell循环。例如:

You can run a shell loop over the output of conda env list. For example:

for env in $(conda env list | cut -d" " -f1 | tail -n+4); do conda install -n $env XXXXXX; done