kii
kii

Reputation: 497

conda-build complains incorrectly that dependency is not included in meta.yaml

I am trying to build a Python module (wsamdata) as a conda package. conda-build fails with the error message (full output: 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 is a dependency, and therefore I have included it in my meta.yaml (see following), so I am a bit confused to see this message.

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

Obviously click is also included under install_requires=[...] in the wsamdata package's setup.py file:

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",
    ]
)

I cannot share the source for wsamdata, so I understand this is not a reproducible example, but I am stuck and am wondering if I am missing something obvious. I've been able to successfully use conda-build on this machine to build a conda package for python-sa-gwdata.

I have found other similar questions, but they related to conda skeleton setups which produced meta.yaml files with missing requirements. I have instead written this meta.yaml from scratch.

My .condarc file:

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

Upvotes: 6

Views: 2064

Answers (2)

Thanasis Mattas
Thanasis Mattas

Reputation: 514

In case anyone stumbles upon this, I had the same problem and resolved it using

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

options at the pip install command, as suggested in the anaconda cloud documentation

If you are using build.sh or bld.bat, try:

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

or

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

, respectively.

Alternatively, you can add this to your meta.yaml:

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

or, if you are using conda skeleton, for packages already exist in pypi.org:

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

Upvotes: 4

IanSR
IanSR

Reputation: 10556

I had this problem as well and it was rooted in conflicting version information in the setup.py/requirements.txt files compared to the meta.yaml files. Look there and make sure any version specs are identical. I was guided to this thanks to the ML post here:

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

Upvotes: 0

Related Questions