How do I move a Python 3.6 installation a different directory?

Viewed 22245

I have installed Python 3.6.2 Windows in

c:\users\username\AppData\Local\programs\Python\Python36

(because that is the (totally stupid) default.

I have manually moved that into c:\

But the update to Python 3.6.3 still installs to the original target.

How do I change this (without uninstalling (which would also uninstall all packages))?

4 Answers

I am not sure this will be the best answer though the simplest thing to do if you are stuck you could try this.

You could move you installation back to its original location, then update it. Then once complete move it to where you want.


Alternatively, there is a registry value that shows Python installation path. I would check to see if this reflects your new path, if not then updating it may allow your update to work. The location of the registry on my machine is:

Computer\HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.6\InstallPath

If you installed Python for all users, the registry path (64bit Python on 64bit OS) would be:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.8\Idle
  • HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.8\InstallPath
  • HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.8\PythonPath
  • HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.8\Help\Main Python Documentation
  • HKEY_CLASSES_ROOT\Python.File\Shell\editwithidle\shell\edit38\command
  • HKEY_CLASSES_ROOT\Python.NoConFile\Shell\editwithidle\shell\edit38\command

Most likely, the problem is that you didn't change the environment PATH in your windows settings. If you modify the path to c:\Python36 folder everything should be back to norm.

Here are instructions how to do this Modify environment PATH on Windows

I had faced similar problem. For some reason I wanted to change the PC admin but my Python was installed on the old user directory. All updates and repairs I had to do on the same directory.

Then I deleted the python path from registry (Since I wanted to have fresh install later): Computer\HKEY_CURRENT_USER\SOFTWARE\Python and then reinstalled python.

PS: While installing on your home PC its better to install across users. My python is installed at below location: C:\Program Files\Python37

Related