无法在 conda meta.yaml 文件中指定 pip 依赖项

can't specify pip dependency in conda meta.yaml file

为了构建 conda 包,我有以下 meta.yaml 文件:

package:
  name: dsutils
  version: 1.0

source:
  git_rev: cat_files_bq_utils
  git_url: https://**********.git

requirements:
  build:
    - python
    - setuptools

  run:
    - python
    - pandas
    - scipy
    - numpy
    - scikit-learn ==0.17.0
    - google-api-python-client
...

当我尝试 运行 它时,出现以下错误:

Error:  Packages/dependencies missing in current linux-64 channels: 
  - dsutils 1.0 py34_0 -> google-api-python-client
  - google-api-python-client

但是当我摆脱 google-api-python-client 依赖时,包成功构建。请注意 google-api-python-client 无法通过 conda install 命令行安装,但可以使用 pip 安装。

我的问题是:如何在 meta.yaml conda 包文件中指定 pip 依赖项?

如果 conda search 没有显示任何结果,最简单的方法是转到 anaconda.org 并查看其他渠道是否已经为您构建了程序包。

https://anaconda.org/search?q=google-api-python-client&sort=ndownloads&sort_order=1&reverse=true

看起来 pandas 频道有您需要的内容,所以

conda config --append channels pandas

然后 运行 再 conda build