Issue with example python repo on Ubuntu..
# general
c
Issue with example python repo on Ubuntu..
A fresh checkout on
main
and
./pants
gives me this:
Copy code
x@y:~/tst/example-python$ ./pants list ::
Bootstrapping Pants using /usr/bin/python3.8
Creating the virtualenv PEX.
Downloading the Pex PEX.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   640  100   640    0     0   6464      0 --:--:-- --:--:-- --:--:--  6464
100 3529k  100 3529k    0     0  3774k      0 --:--:-- --:--:-- --:--:-- 27.7M
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex> verified.
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/x/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/__main__.py", line 84, in <module>
    from pex.pex_bootstrapper import bootstrap_pex
  File "/home/x/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.bootstrap/pex/pex_bootstrapper.py", line 14, in <module>
    from pex.interpreter import PythonInterpreter
  File "/home/x/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.bootstrap/pex/interpreter.py", line 25, in <module>
    from pex.platforms import Platform
  File "/home/x/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.bootstrap/pex/platforms.py", line 13, in <module>
    from pex.third_party.packaging import tags
  File "/home/x/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.bootstrap/pex/vendor/_vendored/packaging/packaging/tags.py", line 7, in <module>
    import distutils.util
ModuleNotFoundError: No module named 'distutils.util'
mv: cannot stat '/home/x/.cache/pants/setup/bootstrap-Linux-x86_64/pants.meLoy6/virtualenv.pex': No such file or directory
Installing pantsbuild.pants==2.8.0rc5 into a virtual environment at /home/x/.cache/pants/setup/bootstrap-Linux-x86_64/2.8.0rc5_py38
/usr/bin/python3.8: can't open file '/home/x/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.4.7/virtualenv.pex': [Errno 2] No such file or directory
h
c
Thanks, posted that and headed out.. realized that I hadn’t checked if there were any pre-req missing. But, I think we could improve the error message here.. to indicate what’s missing
But that did solve it 🙂
h
Hm, I was going to suggest cherry-picking https://github.com/pypa/packaging/pull/396 into Pex's vendor of packaging to remove this dependency on distutils, but
sysconfig
was only added in Python 3.2+ So Pants would need to drop Py27 support. cc @enough-analyst-54434
e
Wouldn't help. Next issue you'd hit is a lack of
-m venv
support unless you installed
python-venv
on some of the Debian flavors. Can't remember which.
👍 1