conda-build错误地抱怨meta.yaml中不包含依赖项

时间:2019-08-07 04:42:57

标签: python anaconda conda

我正在尝试构建一个Python模块(wsamdata)作为conda软件包。 conda-build失败,并显示错误消息(完整输出:https://pastebin.com/sKXNEcB6

RuntimeError: Setuptools downloading is disabled in conda build.
Be sure to add all dependencies in the meta.yaml  url=https://pypi.org/simple/click/

click是一个依赖项,因此我已将其包含在meta.yaml中(请参阅下文),因此看到此消息有些困惑。

package:
  name: wsamdata
  version: 0.6.0
source:
  git_rev: v0.6.0
  git_url: https://github.com/kinverarity1/wsamdata
requirements:
  build:
    - python
    - pip
    - setuptools
    - numpy
    - pandas
    - geopandas
    - sqlparse
    - click
    - cx_Oracle
    - pillow
    - sqlalchemy
    - python-sa-gwdata>=0.5.4
    - lasio
  run:
    - python
    - numpy
    - pandas
    - geopandas
    - sqlparse
    - click
    - cx_Oracle
    - pillow
    - sqlalchemy
    - python-sa-gwdata>=0.5.4
    - lasio

显然,click也包含在install_requires=[...]程序包的wsamdata文件的setup.py下:

from setuptools import setup

setup(
    name="wsamdata",
    version="0.6.0",
    packages=["wsamdata"],
    install_requires=[
        "python-sa-gwdata>=0.5.4",
        "pandas",
        "geopandas",
        "sqlparse",
        "click",
        "cx_Oracle",
        "pillow",
        "numpy",
        "sqlalchemy",
        "lasio",
    ]
)

我无法共享wsamdata的来源,因此我知道这不是可复制的示例,但是我很困惑,想知道我是否遗漏了一些明显的内容。我已经能够在此计算机上成功使用conda-buildpython-sa-gwdata构建一个conda程序包。

我发现了其他类似的问题,但是它们与conda skeleton设置有关,这些设置产生了meta.yaml个缺少要求的文件。相反,我是从头开始编写此meta.yaml

我的.condarc文件:

channels:
  - kinverarity
  - conda-forge
  - defaults
ssl_verify: true
auto_update_conda: true
always_yes: true
show_channel_urls: true
create_default_packages:
  - pip
  - black
pip_interop_enabled: true
anaconda_upload: false

2 个答案:

答案 0 :(得分:0)

我也遇到了这个问题,它的根源是与setup.py文件相比,requirements.txt / meta.yaml文件中的版本信息冲突。看那里,确保所有版本规格都相同。多亏了这里的ML帖子,我才得以实现这一目标:

https://groups.google.com/a/continuum.io/forum/#!msg/anaconda/dELRaivwdMg/5IWgDcdqAwAJ

答案 1 :(得分:0)

万一有人偶然发现,我遇到了同样的问题,并使用

解决了

--single-version-externally-managed --record=record.txt

根据{{​​3}}

的建议,在pip install命令中使用

选项

如果您使用的是build.shbld.bat,请尝试:

$PYTHON setup.py install --single-version-externally-managed --record=record.txt

"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt

或者,您可以将其添加到您的meta.yaml:

build:
  script: {{ PYTHON }} setup.py install --single-version-externally-managed --record=record.txt

,或者,如果您使用的是anaconda cloud documentation,则对于pypi.org中已经存在的软件包:

build:
  script: {{ PYTHON }} -m pip install . --single-version-externally-managed --record=record.txt --no-deps --ignore-installed --no-cache-dir -vvv