有没有办法在environment.yml中具有特定于平台的依赖项?
我正在尝试使用Conda来设置build&测试项目的环境( LensKit ),并且需要具有特定于平台的依赖项。具体来说,在Linux版本上,我需要 libgfortran
和 openssl
,但在Windows上则不需要。
I'm trying to use Conda to set up build & testing environments for a project (LensKit), and need to have platform-specific dependencies. Specifically, on Linux builds I need libgfortran
and openssl
, but not on Windows.
是否可以在 environment.yml
中声明需要 libgfortran
但仅适用于32位和64位Linux平台?还是需要单独的环境定义来解决这种情况?
Is there a way that I can state, in environment.yml
, that I need libgfortran
but only on the 32- and 64-bit Linux platforms? Or do I need to have separate environment definitions to cover this case?
我看到的另一个潜在解决方案是创建一个虚拟包并将其发布到 http://anaconda.org 仅依赖于每个平台所需的基本软件包,并且需要 environment.yml中的软件包。
。
The other potential solution I see is creating a dummy package and publishing it to http://anaconda.org that just depends on the required base packages for each platform, and require that package in environment.yml
.
虚拟包实际上称为元包。请参阅 http://conda.pydata.org/docs/building/meta-pkg。 html 。
The "dummy packages" are actually called "metapackages". See http://conda.pydata.org/docs/building/meta-pkg.html. That seems a good option.
或者,您可以为项目构建一个conda包吗?在conda食谱的 meta.yml
中,您可以将选择器用于不同的平台。 http://conda.pydata.org/docs/building/meta -yaml.html#preprocessing-selectors
Alternatively, could you build a conda package of your project? In the conda recipe's meta.yml
you can use selectors for different platforms. http://conda.pydata.org/docs/building/meta-yaml.html#preprocessing-selectors