3

As you can see below, after I installed Python 3.11, I came to the realization that running pip3.10 freeze did not list me the packages I had in my Python 3.10.2 but those of my Python 3.11. This is explained by the fact that in Python311\Scripts I have both pip3.10.exe and pip3.11.exe. Is there a reason? When I want to pip install or do pip freeze with pip3.10 I need to use the absolute path now.

enter image description here

  • I'm not sure why that is, so I can't answer. But as a sidenote, you might be interested in [pyenv](https://github.com/pyenv/pyenv) to manage multiple Python versions without going insane. If you also need multiple virtual environments per Python version, it has a plugin ([pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)) to handle that too. – CrazyChucky Nov 04 '22 at 15:26
  • Oh yes I do use virtual environments quite often, it's just that for quick tests I have messy basic environments that I can (usually) call easily with pip3.9, pip3.10, pip3.11, etc ... and I can't really anymore – FluidMechanics Potential Flows Nov 04 '22 at 15:33

1 Answers1

4

This was a pip bug, I don't understand the details exactly but when pip tried to match to the correct Python version it was only accounting for single-digit version numbers, resulting in this weird behavior. Perhaps it is better explained in this thread on github.

To summarize that thread (from user uranusjr):

pip contains logic to specially fix pipX.Y (and easy_install-X.Y) entry points to correctly match the Python version, but that logic only accounts for single-digit version numbers and doesn’t work with 3.10 upwards.

This was fixed with pip version 22.3.1 (Also seen on this github thread), and from what I can tell doesn't occur anymore when using python 3.11.1.

Alexander Freyr
  • 569
  • 1
  • 6
  • 19