jolly-kite-53356
03/27/2023, 7:37 PMCould not find a compatible interpreter.
when running a python source. It seems like pants did find the interpreter defined in PYENV, but skipped them for some reasons
Examined the following working interpreters:
1.)/Users/xx/.pyenv/versions/3.7.16/bin/python3.7 CPython==3.7.16
...
Skipped the following broken interpreters:
1.) /Users/xx/.pyenv/shims/python3.7:
pyenv: python3.7: command not found
The `python3.7' command exists in these Python versions:
3.7.16
Note: See 'pyenv help global' for tips on allowing both
python2 and python3 to be found.
enough-analyst-54434
03/27/2023, 7:46 PMjolly-kite-53356
03/27/2023, 7:46 PM/Users/xx/.pyenv/shims/python3.7 --version
Python 3.7.16
enough-analyst-54434
03/27/2023, 7:47 PMPYENV_LOCAL
?: https://www.pantsbuild.org/docs/reference-python-bootstrap#search_pathcurved-television-6568
03/27/2023, 7:49 PMpyenv: python3.7: command not found
this means that you don’t have an “selected” version of python3.7, however the next lines tells you there is one installed.
https://github.com/pyenv/pyenv#switch-between-python-versionsjolly-kite-53356
03/27/2023, 8:02 PMProcessExecutionFailure: Process 'Find interpreter for constraints: CPython==3.10.9,==3.7.*' failed with exit code 102.
stdout:
stderr:
Could not find a compatible interpreter.
Examined the following working interpreters:
1.) /Users/xx/.pyenv/versions/3.7.16/bin/python3.7 CPython==3.7.16
2.) /Users/xx/.pyenv/versions/3.10.9/bin/python3.10 CPython==3.10.9
3.) /Users/xx/.pyenv/versions/3.8.16/bin/python3.8 CPython==3.8.16
4.) /opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 CPython==3.11.2
5.) /opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10 CPython==3.10.10
6.) /opt/homebrew/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/bin/python3.9 CPython==3.9.16
7.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6
Skipped the following broken interpreters:
1.) /Users/xx/.pyenv/shims/python3.8:
pyenv: python3.8: command not found
The `python3.8' command exists in these Python versions:
3.8.16
/Users/xx/.pyenv/versions/3.7.16/bin/python3.7 --version
Python 3.7.16
enough-analyst-54434
03/27/2023, 8:03 PMjolly-kite-53356
03/27/2023, 8:05 PMpython_source(
name="dev",
source="main.py",
run_goal_use_sandbox=False,
resolve="ai",
interpreter_constraints=["==3.7.*"],
dependencies=[":alignment"],
)
python_sources(
name="alignment"
resolve="ai",
)
and this is the settings in pants.toml
[python]
interpreter_constraints = ["CPython==3.10.9"]
enable_resolves = true
default_resolve = "python-default"
[python.resolves_to_interpreter_constraints]
ai = ["==3.7.*"]
interpreter_constraints=["==3.7.*"],
to the dependencies, that fixed the issue. Thank you!