cool-easter-32542
11/28/2024, 3:51 AMpants generate-lockfiles, and the following error message appeared:
pip: File "/home/***/.cache/pants/named_caches/pex_root/venvs/***/lib/python3.10/site-packages/pip/_vendor/packaging/tags.py", line 7, in <module>
pip: import distutils.util
pip: ModuleNotFoundError: No module named 'distutils.util'
After debugging, I found that it uses Python 3.10 from the /usr/bin path because I installed a Python interpreter that fulfills the interpreter constraints. I tried to resolve this by updating the search path to search_path = ["<PYENV>", "<PYENV_LOCAL>"] and setting interpreter_constraints = ['>=3.10-dev,<3.12-dev']. My goal is to use the Python interpreter installed via pyenv, which includes the distutils package. I installed the interpreter with the 3.10-dev version.
My question:
1. Is the interpreter selection determined by the lowest fulfilled version available in the search_path? For example: intepreter_constraints = ['>=3.10,<3.12'] search_path = ["<PYENV_LOCAL>", "/usr/bin"]
2. How can I properly define interpreter_constraints for a <major>.<minor>-dev version? When I use interpreter_constraints = ['>=3.10-dev,<3.12-dev'], it works without error, but there is no documentation explaining how to specify constraints for <major>.<minor>-dev.
Note:
1. ...
[python]
interpreter_constraints = ['>=3.10,<3.12']
...
[python-bootstrap]
search_path = ["<PYENV_LOCAL>", "/usr/bin"]
New pants.toml
...
[python]
interpreter_constraints = ['>=3.10-dev,<3.12-dev']
enable_resolves = true
[python-bootstrap]
search_path = ["<PYENV>", "<PYENV_LOCAL>"]
pantsbuild/pantscool-easter-32542
12/17/2024, 6:12 AM