Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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))?

like image 903
Ruediger Jungbeck Avatar asked Oct 04 '17 08:10

Ruediger Jungbeck


People also ask

How do I change my Python installation path?

To change install location, click on Customize installation , then Next and enter C:\python35 (or another appropriate location) as the install location. If you didn�t check the Add Python 3.5 PATH option earlier, check Add Python to environment variables .

How do I move Python to another directory?

Move () is the most used method of Python to move the file from one directory to another directory defined in the shutil module. Another way of moving file location by using rename() method that is defined in the os module.

How do I move Python to D drive?

Open Advanced tab and select Environment Variables. In the System variable section, select "Path" and give Edit option. Now click New and type "D:\Python\"(for my example) in the new row. Click okay.


1 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
like image 140
CodeCupboard Avatar answered Sep 21 '22 02:09

CodeCupboard