<#17221 ModuleNotFoundError: No module named 'pex'...
# github-notifications
q
#17221 ModuleNotFoundError: No module named 'pex' Issue created by engnatha Describe the bug When running pants in our CI system, we can have a container that has multiple clones of our repository. At various points, they will be running goals like
./pants export
or
./pants run
. At some point in the chain, we see errors like this
Copy code
10:42:12.54 [INFO] Initialization options changed: reinitializing scheduler...
10:42:13.10 [INFO] Scheduler initialized.
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/buildbot/.pex/unzipped_pexes/7907cee4a80399696d31dbee748702a492b91a80/__main__.py", line 102, in <module>
    from pex.pex_bootstrapper import bootstrap_pex
ModuleNotFoundError: No module named 'pex'
The only way to remedy this seems to be clearing out
~/.pex
and trying the goal again. Pants version 2.13.0 OS Ubuntu 20.04 Additional info We've tried adding some steps to manage concurrency in the system and automatically wipe
~/.pex
when this error is detected, but that's unreliable to implement everywhere. Some initially debugging was kindly provided by @jsirois who filed #17176 to resolve. pantsbuild/pants
u