most pants commands failing for me with “ModuleNot...
# general
g
most pants commands failing for me with “ModuleNotFoundError: No module named ‘pex.bin’” and
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython<4,>=3.7' failed with exit code 1.
e.g.
./pants fmt pushdown_service/::
why would this happen? sorry, I can’t share the repo as it’s not open source
Copy code
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython<4,>=3.7' failed with exit code 1.
stdout:

stderr:
Traceback (most recent call last):
  File "/Users/maheshvashishtha/opt/anaconda3/envs/modin-dev/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/maheshvashishtha/opt/anaconda3/envs/modin-dev/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/__main__.py", line 103, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex_bootstrapper.py", line 601, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 540, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 447, in _wrap_coverage
    return runner(*args)
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 478, in _wrap_profiling
    return runner(*args)
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 567, in _execute
    return self.execute_entry(
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 749, in execute_entry
    return self.execute_entry_point(entry_point)
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/pex.py", line 766, in execute_entry_point
    runner = entry_point.resolve()
  File "/Users/maheshvashishtha/.cache/pants/named_caches/pex_root/unzipped_pexes/2aac9312154c299fac910874b778e800dca4c62a/.bootstrap/pex/dist_metadata.py", line 724, in resolve
    module = importlib.import_module(self.module)
  File "/Users/maheshvashishtha/opt/anaconda3/envs/modin-dev/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pex.bin'
h
I wonder if anaconda might be an issue. Try using pyenv to install an interpreter, and then run the Pants command with
--python-bootstrap-search-path="['<PYENV>']"
(that’s the literal string
<PYENV>
), just to isolate if that’s the issue.
g
@happy-kitchen-89482 I have a python3.11 at /Users/maheshvashishtha/.pyenv/versions/3.11.0/bin/python3.11 from pyenv. I now get `ProcessExecutionFailure: Process ‘Searching for
python
on PATH=/Users/maheshvashishtha/.pyenv/versions/3.11.0/bin’ failed with exit code -9.`
pants was working for me on this machine earlier. I don’t know what changed
upgrading pants to 2.14 worked 🤷 but i don’t know whether this project can use pants 2.14 at the moment
removing a bunch of pants artifacts with ``rm -rf ~/.cache/pants ~/.pex dist .pids .pants.d` seemed to work
h
Hmmm. Glad this works now, but this is concerning. Do let us know if you encounter it again! Probably the upgrade had the same effect as nuking those caches (or some of them).