agreeable-dinner-4950
07/06/2023, 9:55 AM08:58:07.37 [ERROR] 1 Exception encountered:
Engine traceback:
in `run` goal - environment:local
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython==3.8.*' failed with exit code 1.
stdout:
stderr:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/pants-sandbox-YzENq0/.tmp/tmp26el07zn/__main__.py", line 106, in <module>
bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
File "/tmp/pants-sandbox-YzENq0/.tmp/tmp26el07zn/.bootstrap/pex/pex_bootstrapper.py", line 615, in bootstrap_pex
maybe_reexec_pex(interpreter_test=interpreter_test)
File "/tmp/pants-sandbox-YzENq0/.tmp/tmp26el07zn/.bootstrap/pex/pex_bootstrapper.py", line 390, in maybe_reexec_pex
resolved = target.resolve_base_interpreter()
File "/tmp/pants-sandbox-YzENq0/.tmp/tmp26el07zn/.bootstrap/pex/interpreter.py", line 1182, in resolve_base_interpreter
raise self.BaseInterpreterResolutionError("\n".join(message))
pex.interpreter.BaseInterpreterResolutionError: Failed to resolve the base interpreter for the virtual environment at /company/dist/export/python/virtualenvs/default/3.8.17.
Search of base_prefix /usr/local found no equivalent interpreter for /company/dist/export/python/virtualenvs/default/3.8.17/bin/python3.8
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
The python interpreter does exist in my dist folder under: dist/export/python/virtualenvs/default/3.8.17/bin/python
Has anyone had similar problems before?happy-kitchen-89482
07/06/2023, 10:56 AMhappy-kitchen-89482
07/06/2023, 10:57 AMdist
venv is, I assume, created by pants via the export
goal, which it can only do if it first knew about the underlying interpreter via that optionhappy-kitchen-89482
07/06/2023, 10:57 AMagreeable-dinner-4950
07/06/2023, 12:33 PM[python-bootstrap]
search_path = ["/usr/local/bin/python"]
Afterwards I reinstalled pants and I no longer have this issuehappy-family-315
09/12/2023, 12:44 PMhappy-family-315
09/12/2023, 1:25 PMhappy-kitchen-89482
09/12/2023, 7:38 PMpython-bootstrap
controls where Pants looks for interpreters to be used with your code (e.g., to run your tests). The standalone python interpreter is purely an implementation detail that should not be used for your code.happy-family-315
09/19/2023, 1:05 PMthousands-plumber-33255
12/15/2023, 4:09 PMprocess = subprocess.Popen(
["pants", "run", "django/manage.py", "--", "migrate"], # noqa: S603
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
Invoking the command directly works. If I add back this it also works when invoked from the subprocess:
[python-bootstrap]
search_path = ["/usr/local/bin/python"]
Any idea why?happy-kitchen-89482
12/15/2023, 9:13 PMpants help python-bootstrap
in the subprocess and directly, and see if search_path
has different values in each casehappy-kitchen-89482
12/15/2023, 9:14 PMthousands-plumber-33255
12/18/2023, 10:11 AMcurrent value: [
"<PYENV>",
"<PATH>"
]
PYENV is not set for any of the two. For PATH both have /usr/local/bin
. I am a bit confusedthousands-plumber-33255
12/19/2023, 10:31 AMhappy-kitchen-89482
12/20/2023, 4:55 PM--no-local-cache
, --no-pantsd
) ?thousands-plumber-33255
01/05/2024, 1:58 PMprint(env["PATH"])
before the subprocess call, I can see that the first entry is something I am not seeing in my normal bash: /tmp/pantsbuild/pants-sandbox-5NyfTp/.cache/pex_root/venvs/4eb70be5ead3e38b8fe83ba6d941fbd121ff672b/3bd8dd039b6717ea08ba315fc4068d8debf47674/bin:/home/vscode/.local/bin:/home/vscode/.pulumi/bin:/usr/local/python/current/bin:/usr/local/py-utils/bin:/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/share/nvm/versions/node/v16.20.2/bin:/vscode/vscode-server/bin/linux-x64/8b617bd08fd9e3fc94d14adb8d358b56e3f72314/bin/remote-cli:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:
I think I did not mention one small detail: That python file where pants is called in turn is called by pants with pants run
. So I guess pants is adding that sandbox here and there it is looking for an interpreter there, which is of course not present. This also happens when I call a packaged PEX for this programm as well.
What confuses me is that this seems not related to the pants version as that did not change but due to the Python version?!happy-kitchen-89482
01/06/2024, 12:17 AMsubprocess
to execute pants run
, so Pants within Pants?