有没有办法在environment.yml中具有特定于平台的依赖项? [英] Is there a way to have platform-specific dependencies in environment.yml?

查看:63
本文介绍了有没有办法在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

这篇关于有没有办法在environment.yml中具有特定于平台的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆