我有以下 meta.yaml 文件来构建一个 conda 包:
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 并查看其他 channel 是否已经为您构建了包。
https://anaconda.org/search?q=google-api-python-client&sort=ndownloads&sort_order=1&reverse=true
看起来 pandas
channel 有您需要的东西,所以
conda config --append channels pandas
然后再次运行 conda build
。
关于python - 无法在 conda meta.yaml 文件中指定 pip 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37541084/