«

»

Oct 11 2012

Print this Post

Restoring Your Python Registry in Windows

For some odd reason the Python registry occasionally disappears, and when it does it prevents one from being able to install new modules via the Windows MSI installer.

Here is a quick fix that can be done to restore the registry and allow you to get back to writing some awesome Python code.

First step is to open your favorite text editor, Notepad++, Sublime Text 2, or just plain old Notepad.

Copy the following code and paste it into the editor, or you can download this sample fix_python.reg file.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Python]

[HKEY_CURRENT_USER\Software\Python\Pythoncore]

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6]

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6\InstallPath]
@="C:\\python26"

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6\PythonPath]
@="C:\\python26;C:\\python26\\Lib\\;C:\\python26\\DLLs\\"

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7]

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\InstallPath]
@="C:\\python27"

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\PythonPath]
@="C:\\python27;C:\\python27\\Lib\\;C:\\python27\\DLLs\\"

Modify the paths to match your environment, e.g., C:\python27

Save the file to your desktop or other path.

Double-click the file, and follow the prompts to load the new values into the Windows Registry.

Voila! The Python registry has been restored.

Permanent link to this article: http://ericsilva.org/2012/10/11/restoring-your-python-registry-in-windows/

2 comments

  1. johnppcexpert

    Hello, Pls how can i do this for python 3.6 on windows 10

  2. Eric Silva

    Should be a similar process with different paths to your Python 3.6 install location. A you can also reference http://stackoverflow.com/questions/17872234/how-to-add-python-to-windows-registry.

Leave a Reply