https://pantsbuild.org/ logo
#general
Title
# general
f

fresh-cat-90827

12/21/2021, 11:05 PM
I am failing to produce a PEX using a wheel that contains some extended metadata in
Requires-Dist
section that may confuse
pip
; thread has details.
Copy code
Exception message: 1 Exception encountered:

  ProcessExecutionFailure: Process 'Building project/project-name.pex with 5 requirements: PyYAML, protobuf==3.18.1, .(omitted)., wxpython==4.1.1' failed with exit code 1.
stdout:

stderr:
ERROR: Cannot install package-name==86.0.0 and wxpython==4.1.1 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies>
pid 84787 -> /Users/username/.cache/pants/named_caches/pex_root/venvs/d2d8d4b12b561145e584265c5ad878096fafd801/4bb26c73fc128134a83e24c67f5efafa8dad1707/pex --disable-pip-version-check --no-python-version-warning --exists-action a --use-feature 2020-resolver --isolated -q --cache-dir /Users/username/.cache/pants/named_caches/pex_root --log /private/var/folders/k0/3nssm8v15r5b08k1k1wyhs2r0000gp/T/process-execution8rMYbu/.tmp/tmpxdQOi6/pip.log download --dest /private/var/folders/k0/3nssm8v15r5b08k1k1wyhs2r0000gp/T/process-execution8rMYbu/.tmp/tmpTvAMiU/macosx_10_15_x86_64-cp-38-cp38 --platform macosx_10_15_x86_64 --implementation cp --python-version 38 --abi cp38 --only-binary :all: --constraint constraints.txt PyYAML protobuf==3.18.1 .(omitted). wxpython==4.1.1 --index-url <https://privatepypi/pypi/simple> --extra-index-url <https://pypi.python.org/simple> --retries 5 --timeout 15 exited with 1 and STDERR:
 
 The conflict is caused by:
     package-name 86.0.0 depends on numpy>=1.19.4
     wxpython 4.1.1 depends on numpy<1.17; python_version <= "2.7"
 
 To fix this you could try to:
 1. loosen the range of package versions you've specified
 2. remove package versions to allow pip attempt to solve the dependency conflict
When I inspect the metadata of the wxpython wheel I see
Copy code
Requires-Dist: pillow
Requires-Dist: six
Requires-Dist: numpy (<1.17) ; python_version <= "2.7"
Requires-Dist: numpy ; python_version >= "3.0"
I assume this syntax is to say - if you are on Python <=2.7, then please use `numpy`<1.17 otherwise if you are on Python 3, use any
numpy
version. However, it looks as if it’s only picking up Python 2.7 condition and completely ignores the Python 3 section. Oddly enough, if I run the
pex_binary
target with
./pants run
, it is able to build the
requirements.pex
with those dependencies and the program runs fine. So this happens only when calling
./pants package
. Does this suggest there may be a bug in pip handling those
Requires-Dist
sections and I should visit https://github.com/pypa/pip/issues :)
e

enough-analyst-54434

12/21/2021, 11:35 PM
@fresh-cat-90827 what version of Pants is this?
I ask because there is a Pip bug in play here (https://github.com/pypa/pip/issues/10050), but I worked around it (https://github.com/pantsbuild/pex/pull/1367) in Pex 2.1.43 which Pants was updated past by 2.7.0.
f

fresh-cat-90827

12/22/2021, 6:53 AM
oh very sorry, forgot to mention — it’s
2.6.1
h

happy-kitchen-89482

12/22/2021, 7:23 AM
Aha, could you try upgrading to 2.7.2?
f

fresh-cat-90827

12/22/2021, 7:28 AM
not atm, no — I am waiting for
2.9.0
release 🙂 John has provided some extra flags I have to use to avoid building a local wheelhouse 🙂 please see https://pantsbuild.slack.com/archives/C046T6T9U/p1639514317185300?thread_ts=1636782893.243300&amp;cid=C046T6T9U. I’ll experiment running the commands above in
2.9.1rc1
just to explore
oh can confirm the problem is not reproducible in
2.7.1
h

happy-kitchen-89482

12/22/2021, 12:25 PM
Great
6 Views