Error on building python conda recipe

2019-07-22 21:11发布

问题:

After I got help on how to refer to a github repository in my conda recipe for the osrm github repository I get an error message and script is stopping.

My bld.bat file is:

python setup.py install
if errorlevel 1 exit 1

meta.yaml

package:
  name: osrm
  version: 0.11.1

source:
    git_url: git@github.com/ustroetz/python-osrm.git

requirements:
  build:
    - python
    - setuptools
  run:
    - python

test:
  imports: 
    - osrm

about:
  home: https://github.com/ustroetz/python-osrm
  license: MIT
  license_file: LICENSE

When I run conda build osrm/ I get the following output:

PS C:\Users\Samuel\Desktop> conda build osrm/
BUILD START: osrm-0.11.1-py36_0
updating index in: C:\Users\Samuel\Anaconda3\conda-bld\win-64
updating index in: C:\Users\Samuel\Anaconda3\conda-bld\noarch

The following NEW packages will be INSTALLED:

    certifi:        2017.1.23-py36_0 conda-forge
    pip:            9.0.1-py36_0     conda-forge
    python:         3.6.1-0          conda-forge
    setuptools:     33.1.1-py36_0    conda-forge
    vs2015_runtime: 14.0.25420-0     conda-forge
    wheel:          0.29.0-py36_0    conda-forge
    wincertstore:   0.2-py36_0       conda-forge

BUILD START: osrm-0.11.1-py36_0
updating index in: C:\Users\Samuel\Anaconda3\conda-bld\win-64
updating index in: C:\Users\Samuel\Anaconda3\conda-bld\noarch

The following NEW packages will be INSTALLED:

    certifi:        2017.1.23-py36_0 conda-forge
    pip:            9.0.1-py36_0     conda-forge
    python:         3.6.1-0          conda-forge
    setuptools:     33.1.1-py36_0    conda-forge
    vs2015_runtime: 14.0.25420-0     conda-forge
    wheel:          0.29.0-py36_0    conda-forge
    wincertstore:   0.2-py36_0       conda-forge


WARNING: conda-build appears to be out of date. You have version 2.1.7 but the
latest version is 2.1.8. Run

conda update -n root conda-build

to get the latest version.

Cloning into 'C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work'...
done.
checkout: 'HEAD'
Your branch is up-to-date with 'origin/_conda_cache_origin_head'.
==> git log -n1 <==

fatal: No names found, cannot describe anything.
commit 3c7980817e3ddd95c5e7e0863140311fa839bd3d
Merge: 2ab1f6c db984ef
Author: Uli Stroetz <uli@door2door.io>
Date:   Mon Oct 31 18:26:35 2016 +0100

    Merge pull request #6 from mthh/master

    Update to OSRM v5 API

==> git describe --tags --dirty <==

commit 3c7980817e3ddd95c5e7e0863140311fa839bd3d
Merge: 2ab1f6c db984ef
Author: Uli Stroetz <uli@door2door.io>
Date:   Mon Oct 31 18:26:35 2016 +0100

    Merge pull request #6 from mthh/master

    Update to OSRM v5 API

==> git status <==

On branch _conda_cache_origin_head
Your branch is up-to-date with 'origin/_conda_cache_origin_head'.
nothing to commit, working tree clean

Package: osrm-0.11.1-py36_0
source tree in: C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CONDA_BUILD=1"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PYTHONNOUSERSITE=1"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CONDA_DEFAULT_ENV=C:\Users\Samuel\Anaco
srm_1490644832910\_b_env"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "ARCH=64"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PREFIX=C:\Users\Samuel\Anaconda3\conda-
832910\_b_env"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SYS_PREFIX=C:\Users\Samuel\Anaconda3"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SYS_PYTHON=C:\Users\Samuel\Anaconda3\py

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SUBDIR=win-64"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SRC_DIR=C:\Users\Samuel\Anaconda3\conda
4832910\work"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "HTTPS_PROXY="

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "HTTP_PROXY="

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "DIRTY="

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "ROOT=C:\Users\Samuel\Anaconda3"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PYTHON=C:\Users\Samuel\Anaconda3\conda-
832910\_b_env\python.exe"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PY3K=1"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "STDLIB_DIR=C:\Users\Samuel\Anaconda3\co
0644832910\_b_env\Lib"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SP_DIR=C:\Users\Samuel\Anaconda3\conda-
832910\_b_env\Lib\site-packages"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PY_VER=3.6"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CONDA_PY=36"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PERL=C:\Users\Samuel\Anaconda3\conda-bl
2910\_b_env\perl.exe"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PERL_VER=5.20.3"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LUA=C:\Users\Samuel\Anaconda3\conda-bld
910\_b_env\lua.exe"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LUA_INCLUDE_DIR=C:\Users\Samuel\Anacond
m_1490644832910\_b_env\include"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LUA_VER=5.2"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PKG_NAME=osrm"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PKG_VERSION=0.11.1"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PKG_BUILDNUM="

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PKG_BUILD_STRING=py36_0"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "RECIPE_DIR=C:\Users\Samuel\Desktop\osrm

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CPU_COUNT=4"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SHLIB_EXT=.dll"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "PATH=C:\Users\Samuel\Anaconda3\conda-bl
2910\_b_env;C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\Library\mingw-w64\bin;C:\Users
3\conda-bld\osrm_1490644832910\_b_env\Library\usr\bin;;C:\Users\Samuel\Anaconda3\conda-bld\osrm_14906448
rary\bin;C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\Scripts;C:\Users\Samuel\Anaconda3
1490644832910\_b_env\Scripts;C:\Users\Samuel\Anaconda3\Library\bin;C:\Users\Samuel\Anaconda3\Library\bin
s\Gurobi\win64\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System3
S\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Windows Ki
erformance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GDAL;C:\Python27\Scripts;C:\Python27
es (x86)\GDAL\lib;C:\Program Files (x86)\GDAL\include;C:\Users\Samuel\Anaconda3;C:\Users\Samuel\Anaconda
rs\Samuel\Anaconda3\Library\bin;C:\Users\Samuel\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Us
ta\Local\Programs\Python\Python36-32\;C:\Users\Samuel\AppData\Local\Microsoft\WindowsApps; C:\Program Fi

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SCRIPTS=C:\Users\Samuel\Anaconda3\conda
4832910\_b_env\Scripts"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LIBRARY_PREFIX=C:\Users\Samuel\Anaconda
_1490644832910\_b_env\Library"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LIBRARY_BIN=C:\Users\Samuel\Anaconda3\c
90644832910\_b_env\Library\bin"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LIBRARY_INC=C:\Users\Samuel\Anaconda3\c
90644832910\_b_env\Library\include"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LIBRARY_LIB=C:\Users\Samuel\Anaconda3\c
90644832910\_b_env\Library\lib"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "R=C:\Users\Samuel\Anaconda3\conda-bld\o
0\_b_env\Scripts\R.exe"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CYGWIN_PREFIX=/cygdrive/c/Users/Samuel/
bld/osrm_1490644832910/_b_env"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "SYSTEMROOT=C:\WINDOWS"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "WINDIR=C:\WINDOWS"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CONDA_BUILD_STATE=BUILD"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set DISTUTILS_USE_SDK=1

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set MSSdk=1

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set PY_VCRUNTIME_REDIST=C:\Users\Samuel\Anac
osrm_1490644832910\_b_env\Library\bin\vcruntime140.dll

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "VS_VERSION=14.0"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "VS_MAJOR=14"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "VS_YEAR=2015"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "CMAKE_GENERATOR=Visual Studio 14 2015 W

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>call "C:\Program Files (x86)\Microsoft Visua
mmon7\Tools\..\..\VC\vcvarsall.bat" amd64

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "INCLUDE=C:\Users\Samuel\Anaconda3\conda
4832910\_b_env\Library\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program
dows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program
dows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>set "LIB=C:\Users\Samuel\Anaconda3\conda-bld
910\_b_env\Library\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files
its\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;"

C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\work>call "C:\Users\Samuel\Anaconda3\Scripts\acti
ers\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env"

(C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env) C:\Users\Samuel\Anaconda3\conda-bld\osrm
ork>REM ===== end generated header =====

(C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env) C:\Users\Samuel\Anaconda3\conda-bld\osrm
ork>python setup.py install
running install
running bdist_egg
running egg_info
creating osrm.egg-info
writing osrm.egg-info\PKG-INFO
writing dependency_links to osrm.egg-info\dependency_links.txt
writing requirements to osrm.egg-info\requires.txt
writing top-level names to osrm.egg-info\top_level.txt
writing manifest file 'osrm.egg-info\SOURCES.txt'
reading manifest file 'osrm.egg-info\SOURCES.txt'
writing manifest file 'osrm.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\osrm
copying osrm\core.py -> build\lib\osrm
copying osrm\extra.py -> build\lib\osrm
copying osrm\__init__.py -> build\lib\osrm
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\osrm
copying build\lib\osrm\core.py -> build\bdist.win-amd64\egg\osrm
copying build\lib\osrm\extra.py -> build\bdist.win-amd64\egg\osrm
copying build\lib\osrm\__init__.py -> build\bdist.win-amd64\egg\osrm
byte-compiling build\bdist.win-amd64\egg\osrm\core.py to core.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\osrm\extra.py to extra.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\osrm\__init__.py to __init__.cpython-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying osrm.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying osrm.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying osrm.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying osrm.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying osrm.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\osrm-0.11.1-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing osrm-0.11.1-py3.6.egg
Copying osrm-0.11.1-py3.6.egg to c:\users\samuel\anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-
Adding osrm 0.11.1 to easy-install.pth file

Installed c:\users\samuel\anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\osrm-0.11.1-py
Processing dependencies for osrm==0.11.1
Searching for matplotlib
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    install_requires=requirements
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\distutils\core.py", line 148,
    dist.run_commands()
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\distutils\dist.py", line 955,
    self.run_command(cmd)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\distutils\dist.py", line 974,
    cmd_obj.run()
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
line 67, in run
    self.do_egg_install()
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
line 117, in do_egg_install
    cmd.run()
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
py", line 411, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
py", line 655, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
py", line 702, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
py", line 747, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\pkg_resources\__
 846, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\pkg_resources\__
 1118, in best_match
    return self.obtain(req, installer)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\pkg_resources\__
 1130, in obtain
    return installer(requirement)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\comma
py", line 662, in easy_install
    not self.always_copy, self.local_index
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\packa
ne 639, in fetch_distribution
    self.find_packages(requirement)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\packa
ne 480, in find_packages
    self.scan_url(self.index_url + requirement.unsafe_name + '/')
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\packa
ne 812, in scan_url
    self.process_url(url, True)
  File "C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env\lib\site-packages\setuptools\packa
ne 317, in process_url
    "Be sure to add all dependencies in the meta.yaml  url=%sr" % url)
RuntimeError: Setuptools downloading is disabled in conda build. Be sure to add all dependencies in the
ttps://pypi.python.org/simple/matplotlib/r

(C:\Users\Samuel\Anaconda3\conda-bld\osrm_1490644832910\_b_env) C:\Users\Samuel\Anaconda3\conda-bld\osrm
ork>if errorlevel 1 exit 1
Traceback (most recent call last):
  File "C:\Users\Samuel\Anaconda3\Scripts\conda-build-script.py", line 5, in <module>
    sys.exit(conda_build.cli.main_build.main())
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\cli\main_build.py", line 334, in main
    execute(sys.argv[1:])
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\cli\main_build.py", line 325, in execute
    noverify=args.no_verify)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\api.py", line 97, in build
    need_source_download=need_source_download, config=config)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\build.py", line 1502, in build_tree
    config=config)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\build.py", line 1104, in build
    windows.build(m, build_file, config=config)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\windows.py", line 231, in build
    check_call_env(cmd, cwd=src_dir)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\utils.py", line 616, in check_call_env
    return _func_defaulting_env_to_os_environ(subprocess.check_call, *popenargs, **kwargs)
  File "C:\Users\Samuel\Anaconda3\lib\site-packages\conda_build\utils.py", line 612, in _func_defaulting
on
    return func(_args, **kwargs)
  File "C:\Users\Samuel\Anaconda3\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmd.exe', '/c', 'bld.bat']' returned non-zero exit status 1.

Why am I getting this error? Thanks!

回答1:

The error is that you need to list all the dependencies of the package in the meta.yaml file - apparently, you've missed one because of this error message:

RuntimeError: Setuptools downloading is disabled in conda build. Be sure to add all dependencies in the meta.yaml

Given the package it was looking for prior to the start of the traceback,

Processing dependencies for osrm==0.11.1
Searching for matplotlib
Traceback (most recent call last):
...

I suspect this particular error is because Matplotlib isn't in your dependencies, but there may be others as well.