0

I had Python 3.6 on my Windows machine under "C:\Program Files" I wanted to upgrade it to 3.11. Installer completed successfully, but new version was installed not in program files, but in "C:\Users\myname\AppData\Local\Programs\Python\Python311".

I moved Python311 directory to the "C:\Program Files" and python itself does work, but pip is not working anymore. when I am trying to do

pip --version

I am getting

Fatal error in launcher: Unable to create process using '"C:\Users\myname\AppData\Local\Programs\Python\Python311\python.exe" "C:\Program Files\Python311\Scripts\pip.exe" --version': The system cannot find the file specified.

Can someone please tell me what I need to do to fix it?

Gary Greenberg
  • 468
  • 1
  • 9
  • 22

1 Answers1

1

Don't move installed programs around in windows. Your error is directly caused by this, the path of python(C:\Users\myname\AppData\Local\Programs\Python\Python311\python.exe) is hard coded into pip (and probably more places), so all you are doing is breaking stuff.

There is nothing wrong with python being installed in AppData. That is what that directory is for. At least for programs that are only installed for your user. If you really want to install to a different directory, then uninstall and reinstall. This time, choose Customize installation on the first screen of the installation. Also make sure to uninstall the 3.6 version and select Add python.exe to PATH in the new installation

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53