如何在 environment.yml 中安装 CRAN 包

时间:2021-01-31 22:08:39

标签: r github conda cran

我正在使用 miniconda 来管理我的数据科学包安装。这是我现在已经建立起来的一个工作流程,所以我希望它也能在这种情况下工作。我也认为它可以工作,因为它应该在这种情况下提供帮助 - 需要比纯 python 更多的依赖项。

我想安装 python cdt toolbox。它是 PyPI 上可用的 pip 可安装包,但不在任何 conda 频道中。它需要 PyTorch,可在 PyPI 和他们自己的 conda 频道中轻松获得。但它进一步需要一些 r 包,大多数在 CRAN 上可用,有些仅在 github 上可用。我梦想的场景是有一个看起来像这样的 environment.yml 文件:

name: my_env
channels:
 - defaults
 - pytorch
dependencies:
 - pytorch
 - cpuonly
 - pip
 - pip:
   - cdt
   - -e .
 - r:         # this line and below don't work...
   - pcalg    # available on CRAN, but not in conda channel r
   - kpcalg   # available on CRAN, but not in conda channel r
   - github:https://github.com/Diviyan-Kalainathan/RCIT # R package not in CRAN nor on conda

基于 this question on SO about similar npm installs,我认为没有像上面那样简单直接的方法。我不可能是第一个需要同时安装 r 和 python 包的人……那么“标准”解决方法是什么?

0 个答案:

没有答案
相关问题