<#15171 Poetry locking tries to combine a global P...
# github-notifications
c
#15171 Poetry locking tries to combine a global Poetry PEX with per-resolve `Requires-Python` (ICs), which can fail. Issue created by jsirois Reported as:
Copy code
% python --version           
Python 3.10.3

% pyenv version              
global-3.10.3 (set by PYENV_VERSION environment variable)

% ./pants generate-lockfiles 
Bootstrapping Pants using /Users/mike/.pyenv/shims/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.62/pex> verified.
Installing pantsbuild.pants==2.11.0rc3 into a virtual environment at /Users/mike/.cache/pants/setup/bootstrap-Darwin-x86_64/2.11.0rc3_py39
New virtual environment successfully created at /Users/mike/.cache/pants/setup/bootstrap-Darwin-x86_64/2.11.0rc3_py39.
09:21:04.25 [INFO] Completed: Generate lockfile for python-default
09:21:04.26 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Generate lockfile for python-default' failed with exit code 1.
stdout:
The currently activated Python version 3.7.12 is not supported by the project (>=3.10).
Trying to find and use a compatible version. 

  NoCompatiblePythonVersionFound
Where
pants.toml
has:
Copy code
[python]
interpreter_constraints = ["CPython>=3.10"]
The workaround was to align the Poetry tool ICs:
Copy code
[poetry]
version = "poetry==1.1.13"
interpreter_constraints = ["CPython>=3.10,<4"]
That workaround though, besides violating DRY, is unworkable the minute there is >1 resolve. pantsbuild/pants