cuddly-egg-75110
11/19/2020, 9:49 PM./pants lint ::
or ./pants repl ::
I get a ModuleNotFoundError: No module named 'pex.bin'
, has anyone seen this before? Google isn't giving me any hints. Full stack-trace in thread, thanks for the help and the awesome product!cuddly-egg-75110
11/19/2020, 9:50 PM13:48:37.99 [INFO] initialization options changed: reinitializing pantsd...
13:48:38.33 [INFO] pantsd initialized.
13:48:38.41 [INFO] No pyenv binary found. Will not use pyenv interpreters.
13:48:39.38 [INFO] Completed: Building pylint.pex with 1 requirement: pylint>=2.4.4,<2.5
13:48:39.39 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 255, in run
engine_result = self._run_v2(goals)
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 182, in _run_v2
return self._maybe_run_v2_body(goals, poll=False)
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 204, in _maybe_run_v2_body
poll_delay=(0.1 if poll else None),
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/init/engine_initializer.py", line 126, in run_goal_rules
goal_product, params, poll=poll, poll_delay=poll_delay
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 569, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 539, in _raise_on_error
wrapped_exceptions=tuple(t.exc for t in throws),
Exception message: 1 Exception encountered:
ProcessExecutionFailure: Process 'Building pylint.pex with 1 requirement: pylint>=2.4.4,<2.5' failed with exit code 1.
stdout:
stderr:
Traceback (most recent call last):
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 446, in execute
exit_code = self._wrap_coverage(self._wrap_profiling, self._execute)
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 378, in _wrap_coverage
return runner(*args)
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 409, in _wrap_profiling
return runner(*args)
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 508, in _execute
return self.execute_entry(self._pex_info.entry_point)
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 610, in execute_entry
return runner(entry_point)
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/pex.py", line 625, in execute_pkg_resources
runner = entry.resolve()
File "/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/__init__.py", line 2481, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'pex.bin'
cuddly-egg-75110
11/19/2020, 9:53 PM~/.cache/pants
and all the temp Pants directories in my project, too.hundreds-father-404
11/19/2020, 9:56 PM--pex-verbosity=9
, then upload here or copy into a gist? (Warning it’ll be a lot of text)cuddly-egg-75110
11/19/2020, 10:00 PMwitty-crayon-22786
11/19/2020, 10:01 PMcuddly-egg-75110
11/19/2020, 10:10 PMpants.toml
, 3.7
also does not work
[python-setup]
interpreter_constraints = ["CPython>=3.8"]
witty-crayon-22786
11/19/2020, 10:11 PM/usr/bin/python3.8
witty-crayon-22786
11/19/2020, 10:12 PMpex: Constraints on interpreters: ['CPython>=3.6'], Matching Interpreter: /usr/bin/python3.8
witty-crayon-22786
11/19/2020, 10:13 PM["CPython>=3.6,<3.7"]
etchundreds-father-404
11/19/2020, 10:14 PMConstraints on interpreters: ['CPython>=3.6'], Matching Interpreter: /usr/local/bin/python3.7
, and that’s the Pex process that fails
So I suspect there’s an issue with /usr/local/bin/python3.7
. And that you avoid it by setting >=3.8
for your constraints because that interpreter ends up getting skipped
(When running Pylint, we use whatever interpreter corresponds to the code you have, as it determines what AST Pylint uses)witty-crayon-22786
11/19/2020, 10:14 PMhundreds-father-404
11/19/2020, 10:15 PM/usr/local/bin/python3.7
not play nicelycuddly-egg-75110
11/19/2020, 10:15 PMwitty-crayon-22786
11/19/2020, 10:17 PM/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap
?hundreds-father-404
11/19/2020, 10:17 PM/usr/local/bin/python3.7 -c 'import sys; print(sys.implementation)'
?cuddly-egg-75110
11/19/2020, 10:21 PMnamespace(_multiarch='x86_64-linux-gnu', cache_tag='cpython-37', hexversion=50791920, name='cpython', version=sys.version_info(major=3, minor=7, micro=5, releaselevel='final', serial=0))
@witty-crayon-22786: Sure thing, its just a toy codebase I am trying this out on right now. Attached!witty-crayon-22786
11/19/2020, 10:26 PMpex/bin/**
is not in there.cuddly-egg-75110
11/19/2020, 10:28 PMhundreds-father-404
11/19/2020, 10:30 PMwitty-crayon-22786
11/19/2020, 11:18 PM/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6
when you get the chance? sorry about thatcuddly-egg-75110
11/19/2020, 11:20 PMwitty-crayon-22786
11/19/2020, 11:47 PMwitty-crayon-22786
11/19/2020, 11:48 PMwitty-crayon-22786
11/19/2020, 11:59 PMhundreds-father-404
11/20/2020, 12:00 AM[pylint]
. The constraints.txt can be used thoughwitty-crayon-22786
11/20/2020, 12:01 AMcuddly-egg-75110
11/20/2020, 12:12 AMrequirements.txt
is empty! (And I don't use constraints.txt
yet, waiting on that poetry
native support :P)hundreds-father-404
11/20/2020, 12:13 AM--pex-verbosity=9
and -ldebug
please? (And temporarily reverting the interpreter constraints workaround)
Stu, that’ll give us the argv being used to create pylint.pexwitty-crayon-22786
11/20/2020, 12:14 AMcuddly-egg-75110
11/20/2020, 12:17 AMcuddly-egg-75110
11/20/2020, 12:29 AM./pants repl :: --pex-verbosity=9 -ldebug
in that example is https://gist.github.com/ziyadedher/4d2e99e2cc0e44bb2379b6e07f7754f8witty-crayon-22786
11/20/2020, 1:08 AMcuddly-egg-75110
11/20/2020, 8:30 PMwitty-crayon-22786
11/20/2020, 8:32 PMhundreds-father-404
11/20/2020, 8:32 PMcuddly-egg-75110
11/20/2020, 8:37 PM/usr/bin
. That workaround works @hundreds-father-404 though I need to use the PATH
env variable rather than the config flag since it doesn't support relative pathswitty-crayon-22786
11/20/2020, 8:39 PM/usr/bin/$BIN -c 'import sys; print(sys.implementation)'
… for the relevant python 3.8 $BIN ?cuddly-egg-75110
11/20/2020, 8:41 PMnamespace(_multiarch='x86_64-linux-gnu', cache_tag='cpython-38', hexversion=50857712, name='cpython', version=sys.version_info(major=3, minor=8, micro=6, releaselevel='final', serial=0))
witty-crayon-22786
11/20/2020, 8:41 PMcuddly-egg-75110
11/20/2020, 8:41 PM/usr/bin
cuddly-egg-75110
11/20/2020, 8:44 PMinterpreter_search_paths = [
"/path/to/my/project/.venv/bin",
]
it works but if I leave it out it fails, both with interpreter_constraints = ["CPython>=3.8"]
cuddly-egg-75110
11/20/2020, 8:45 PMsys.implementation
from my .venv
Python: namespace(_multiarch='x86_64-linux-gnu', cache_tag='cpython-38', hexversion=50857712, name='cpython', version=sys.version_info(major=3, minor=8, micro=6, releaselevel='final', serial=0))
It looks the samewitty-crayon-22786
11/20/2020, 8:45 PMpip list
…? i’m wondering whether the venv is isolating you from some sort of package collision with site-packagescuddly-egg-75110
11/20/2020, 8:48 PMwitty-crayon-22786
11/20/2020, 8:48 PMsetuptools
witty-crayon-22786
11/20/2020, 8:48 PMcuddly-egg-75110
11/20/2020, 8:49 PMsetuptools 50.3.2
is in there, but its at the same version as my venvwitty-crayon-22786
11/20/2020, 8:49 PMwitty-crayon-22786
11/20/2020, 8:50 PMpackaging
, wheel
, setuptools
cuddly-egg-75110
11/20/2020, 8:51 PMcuddly-egg-75110
11/20/2020, 8:51 PMcuddly-egg-75110
11/20/2020, 8:51 PMpoetry
to manage my virtual envhundreds-father-404
11/20/2020, 8:52 PMcuddly-egg-75110
11/20/2020, 8:52 PMwitty-crayon-22786
11/20/2020, 8:52 PMwitty-crayon-22786
11/20/2020, 8:54 PMcuddly-egg-75110
11/20/2020, 8:57 PMFile "/home/ziyadedher/.cache/pants/setup/bootstrap-Linux-x86_64/2.1.0_py37/lib/python3.7/site-packages/pants/bin/local_pants_runner.py", line 255, in run
as part of my stacktrace normal if my interpreter_constraints
is CPython>=3.8
?witty-crayon-22786
11/20/2020, 8:58 PMwitty-crayon-22786
11/20/2020, 8:58 PMcuddly-egg-75110
11/20/2020, 9:00 PMwitty-crayon-22786
11/20/2020, 9:00 PMwitty-crayon-22786
11/20/2020, 9:00 PMcuddly-egg-75110
11/20/2020, 9:00 PMcuddly-egg-75110
11/20/2020, 9:00 PMcuddly-egg-75110
11/20/2020, 9:24 PM./pants repl
if I have CPython>=3.8
passes, but ./pants lint ::
fails with the error without changing anything else.enough-analyst-54434
11/25/2020, 4:02 AMenough-analyst-54434
11/25/2020, 4:05 AMenough-analyst-54434
11/25/2020, 4:06 AMpip list
debugging, which would make sense in the absence of Pex use, should have been irrelevant.enough-analyst-54434
11/25/2020, 6:06 PMjsirois@gill ~/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6 $ PEX_VERBOSE=1 python3.7 . --version
pex: Using the current interpreter /usr/bin/python3.7 since it matches constraints and PYTHONPATH is not set.
pex: Found site-library: /usr/lib/python3.7/site-packages
pex: Tainted path element: /usr/lib/python3.7/site-packages
pex: Scrubbing from user site: /home/jsirois/.local/lib/python3.7/site-packages
pex: Scrubbing from site-packages: /usr/lib/python3.7/site-packages
pex: New sys.path: ['/home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap', '/home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload']
pex: Activating PEX virtual environment from .: 8.8ms
pex: Bootstrap complete, performing final sys.path modifications...
pex: PYTHONPATH contains:
pex: /home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6
pex: * /usr/lib/python37.zip
pex: /usr/lib/python3.7
pex: /usr/lib/python3.7/lib-dynload
pex: /home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.deps/pex-2.1.21-py2.py3-none-any.whl
pex: /home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.bootstrap
pex: * - paths that do not exist or will be imported via zipimport
. 2.1.21
The key thing to observe in this good result is the `pex: PYTHONPATH contains:`list which critically contains .deps/pex-2.1.21-py2.py3-none-an.whl
(pex: /home/jsirois/Desktop/issues/arch/home/ziyadedher/.cache/pants/named_caches/pex_root/unzipped_pexes/42d4f75d046397e5f014ec8afd1a39b3ba8787c6/.deps/pex-2.1.21-py2.py3-none-any.whl). That wheen is the source for the pex.bin
package your setup cannot find.enough-analyst-54434
11/25/2020, 6:08 PMPEX_VERBOSE=1 python3.7 . --version
must be run from the .../42d4f75d046397e5f014ec8afd1a39b3ba8787c6/
directory for this to work verbatim.cuddly-egg-75110
11/27/2020, 12:17 AM