Did anyone encounter to following error when runni...
# general
a
Did anyone encounter to following error when running
generate-lockfiles
?
Copy code
option --use-feature: invalid choice: '2020-resolver' (choose from 'fast-deps', 'truststore', 'no-binary-enable-wheel-cache')
g
What version is
pip
for the Python version you're using? I'm going to guess it's too recent. The flag likely comes from here: https://github.com/pantsbuild/pex/blob/e6c03a4f862e6b7dca13404c254d3623c8020c40/pex/pip/tool.py#L262-L264
e
Pex controls which versions of Pip are allowed (as @gorgeous-winter-99296 showed) and has integration tests to back them up; so this sort of error should be impossible. @alert-psychiatrist-14102 please provide details on this error, it makes absolutely no sense and is alarming.
Aha: https://pip.pypa.io/en/stable/news/#v22-3 So @alert-psychiatrist-14102 you both use Python 2 + a Pip version >= 22.3, correct? I'll file an issue, fix and get a Pex release out later today.
👍 1
a
Thank you both! For some reason pants used
python2
for
generate-locks
(I guess it's because I did not have python3-pip installed). Anyway - using
backend.python.provider.experimental.pyenv
solved the issue for me!
e
Ok, I'm glad you have a workaround. Tracked here: https://github.com/pantsbuild/pex/issues/2222
@alert-psychiatrist-14102 what Pants version was this under (and what Pex version if you customized that in
pants.toml
) and what OS? The error actually does make no sense now that I investigate because Pex only allows Python 2.7 to use Pip 20.3.4 which supports
--use-feature 2020-resolver
.
(I guess it's because I did not have python3-pip installed).
No, Pex vendors its own Pip and otherwises installs it itself if a
--pip-version
is selected that is not the vendored (20.3.4) version. Pex is totally hermetic and does not care about your system setup (or it should be totally hermetic anyhow).
a
This was pants 2.16, on Ubuntu. I'm not sure what was my setup exactly now, but i think it was related to things I was missing on the OS. Perhaps even I was missing python3 at this point (but i don't remember exactly already...)
The strangest thing is that my interpreter_constraint is set to python3.9