```22:46:20 00:00 [main] (To run a ...
# pex
r
Copy code
22:46:20 00:00 [main]
               (To run a reporting server: ./pants server)
22:46:21 00:01   [setup]
22:46:21 00:01     [parse]
               Executing tasks in goals: gen -> pyprep -> test
22:46:21 00:01   [gen]
22:46:21 00:01     [thrift-py]
22:46:21 00:01     [py-thrift-namespace-clash-check]
22:46:21 00:01   [pyprep]
22:46:21 00:01     [interpreter]
22:46:21 00:01     [build-local-dists]
22:46:21 00:01     [requirements]
22:46:21 00:01       [cache]
                   No cached artifacts for 22 targets.
                   Invalidated 22 targets.pex: Resolving for:
pex: Isolating pex in Chroot(/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/tmpxvvj_a1o {fs:}): 299.4ms
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/pip-download-wa2d7k0w/pycocotools/PythonAPI/setup.py'"'"'; __file__='"'"'/private/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/pip-download-wa2d7k0w/pycocotools/PythonAPI/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /private/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/pip-download-wa2d7k0w/pycocotools/PythonAPI/pip-egg-info
         cwd: /private/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/pip-download-wa2d7k0w/pycocotools/PythonAPI
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/pip-download-wa2d7k0w/pycocotools/PythonAPI/setup.py", line 2, in <module>
        import numpy as np
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

               Waiting for background workers to finish.
22:46:43 00:23   [complete]
               FAILURE

ERROR: pid: 94702 -> /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -s -m pip --disable-pip-version-check --isolated --exists-action i -q --cache-dir /Users/XXX/.pants.d/python-setup/resolved_requirements download --dest /var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/tmpvp9nqvlx/resolved_dists/cp-37-cp37m --index-url <https://pypi.org/simple/> Cython==0.29.14 numpy==1.17.3 pycocotools@ git+<https://github.com/cocodataset/cocoapi.git@f67e873971bcf289c994e061c5bc359d0bbe8ff7#subdirectory=PythonAPI> raised Executing /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -s -m pip --disable-pip-version-check --isolated --exists-action i -q --cache-dir /Users/XXX/.pants.d/python-setup/resolved_requirements download --dest /var/folders/n6/cx4l_npd6s39czmkmyk2p3tc0000gn/T/tmpvp9nqvlx/resolved_dists/cp-37-cp37m --index-url <https://pypi.org/simple/> Cython==0.29.14 numpy==1.17.3 pycocotools@ git+<https://github.com/cocodataset/cocoapi.git@f67e873971bcf289c994e061c5bc359d0bbe8ff7#subdirectory=PythonAPI> failed with 1
same error if I remove the dependencies @hundreds-father-404
h
what about removing the dependencies and then in the target that depends on
pycocotools
you also explicitly depend on
numpy
and
Cython
?
r
same, this is a clean install, so there is no cached versions of
numpy
and
Cython
, and it still tries to install everything at the same time
e
That issue would have pex work around broken dists. Better is to get the broken dist to use PEP-517/PEP-518, aka pyproject.toml
👍 2
The pex2.x series supports PEP-517/PEP-518
r
will do that, thx !
another question @enough-analyst-54434, what is the purpose of having
Copy code
dependencies=[],
in
python_requirement_library
then ?
what I'm afraid of in my case is that I have a specific version of
numpy
in my
3rdpary
package, and I want
pycocotools
to be built with that version of
numpy
, so that there will be no conflict between
numpy
used to build and
numpy
used later in the system.
e
The dependencies form a graph and a resolve will ask for all dependencies in that graph. So the version of numpy and pycocotools you want will be downloaded. It's after the download, building wheels from sdists, that the problem occurs. Even if PEX (pants uses this) or pip builds the sdists in dependency order, both still only make setuptools and wheel available on the sys.path for the build for setup.py based builds. It's only if the build is PEP-517 / PEP-518 based will PEX and pip know to download build-time dependencies and add them to the build sys.path.