Why does pip install in the Python38 folder, instead of the Python311 folder?

Question:

I keep trying to install pip in various different ways, yet everytime I try to, it does not work. I tried to investigate by going to the Python folder in C:Users(my pc name)AppDataLocalProgramsPython, and even after I deleted my previous Python folders, uninstalled and fixed my PATH variables. Any clue why this is happening?

Update: No solution has been found, so for now I’m going to hard-reset python by uninstalling everything, then trying to reinstall and such. I’ll make a second update if what I try works.

Update 2: Got the same error, so reverted back to 3.10.9, and it was completely fixed. Not sure why 3.11.1 doesn’t work with my pc, but I fixed it by updating my pip.ini file in %APPDATA%pippip.ini .

Asked By: Stylin

||

Answers:

If you have more than one python interpreter, things may become messy.
The best way to do that is by using virtual environments.You can use native python venv, Poetry or even Conda.

Or you could call pip module using the desired interpreter:

c:...path_to_python_3_11python.exe -m pip install my_module

Because in your case older python was installed before latest. Overlap happend in namespase, when new python took python name, but new pip dont.

That issue occurs because pip is actually separate from python. And it have new lead number versions often, which probably occured in betwin your python versions installations.

Deleting all Python versions and clean install, starting from latest version, seems easiest solution.

Answered By: Evgene
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.