Hi All. I am seeing this error while creating pex ...
# pex
n
Hi All. I am seeing this error while creating pex file. I am trying to add
JPype==1.5.0
in requirements.txt. I am running pantsbuild in Ubuntu18 docker container which has python version 3.8.
1.5.0
is the latest version https://pypi.org/project/JPype1/1.5.0/.
Copy code
stderr:
pid 125 -> /root/.cache/pants/named_caches/pex_root/venvs/0deb89b23adbbad7a5b9aac06d2362acf7572cfa/ddab8011daaee380698ac2fb9701af18c90c03f6/bin/python -sE /root/.cache/pants/named_caches/pex_root/venvs/0deb89b23adbbad7a5b9aac06d2362acf7572cfa/ddab8011daaee380698ac2fb9701af18c90c03f6/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --isolated -q --cache-dir /root/.cache/pants/named_caches/pex_root/pip/24.0/pip_cache --log /tmp/pants-sandbox-mXwyjz/.tmp/pex-pip-log.vlev63gc/pip.log download --dest /tmp/pants-sandbox-mXwyjz/.tmp/tmpdyres5k5/usr.bin.python3.8 JPype1==1.5.0 future requests --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
ERROR: Ignored the following versions that require a different python version: 1.4.0 Requires-Python >=3.7; 1.4.1 Requires-Python >=3.7; 1.5.0 Requires-Python >=3.7
ERROR: Could not find a version that satisfies the requirement JPype1==1.5.0 (from versions: 0.5.4.3, 0.5.4.4, 0.5.4.5, 0.5.5, 0.5.5.1, 0.5.5.2, 0.5.5.3, 0.5.5.4, 0.5.6, 0.5.7, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 1.0.1, 1.0.2, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.3.0)
ERROR: No matching distribution found for JPype1==1.5.0




Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.

05:07:34.84 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

InvalidFieldException: collectors: Failed to get dependencies for collectors:reqs#JPype1: The file or directory 'python-default.lock' does not exist on disk in the workspace, so the address 'python-default.lock:_python-default_lockfile' from the `dependencies` field from the target collectors:reqs#JPype1 cannot be resolved.
I am able to resolve the above issue. But now I am seeing
Copy code
stderr:
No pre-built wheel was available for JPype1 1.5.0.
Successfully built the wheel JPype1-1.5.0-cp39-cp39-linux_x86_64.whl from the sdist JPype1-1.5.0.tar.gz but it is not compatible with the requested foreign target abbreviated platform cp38-cp38-linux_aarch64.
You'll need to build a wheel from JPype1-1.5.0.tar.gz on the foreign target platform and make it available to Pex via a `--find-links` repo or a custom `--index`.
h
That pretty much explains what is going on, and gives a potential solution, depending on what you're trying to do.
n
Thanks for your response. Actually I don't see this problem in other third party libraries. So I am wondering what is missing in this case.
h
JPype1 has no Linux ARM wheels, so Pants (via Pex, via Pip) is building one from the sdist, but it is building it in some other environment (python 39 on x86).
Are you running Pants entirely inside that Ubuntu container? What is the hardware architecture? You're not using Pants's
environments
feature?
n
Hi. I am running pants in Ubuntu18 container which x86. I am also using other third party libraries like
future
,
requests
etc. With these libraries I am able to generate pex for both x86 and aarch64.
Do I need to change the container type.
h
You are able to do so with other libraries because they have pre-built wheels for both platforms. JPype1 does not.
It must be built from an sdist, which requires running on the target platform.
Or, as suggested, pre-building it and hosting it somewhere
n
Thanks