Installing PyGTK on Windows x64

If you’re doing any work with Python you might need a user interface as Python doesn't provide one. Once such interface is provided by the GIMP Toolkit (GTK) in the form of Python bindings called PyGTK. PyGTK is actually made up of three dependant libraries:

Installing these bindings on an x64 system (XP, Vista or Windows 7) makes for a challenge. After installing Python 2.x you might find yourself staring at this dialog when you try to install any of these libraries:

What’s happening is that the installer is looking in the registry for an entry to find where Python is installed. You might be looking at your registry and see this under the HKLM node:

While this node is valid (it’s what the Python 2.x installers create) it’s not what the installers for PyGTK are looking for.

The installer will look first under HKLM\Software\Wow6432Node\Python\PythonCore. Failing that, it'll look under HKCU\Software\Python\PythonCore. On x64 systems, the Wow6432Node doesn’t exist however it does exist under HKLM\Software\Python\PythonCore. (there’s no entries under HKCU on x64 systems, at least none that I can find).

There’s a quick fix you can do to get going.

Right click on the existing HKLM\SOFTWARE\Python node and choose Export. Now edit this file and add “Wow6432Node” between “SOFTWARE” and “Python”. So this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Python]

Becomes this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python]

Do this for all of the HKEY_LOCAL_MACHINE lines and save the file.

Now back in the Registry Editor click on File | Import. Select the file you just saved. A dialog will appear saying the information has been successfully imported into the registry (you could also double-click on the .reg file and confirm the import).

Now view the HKLM\Wow6432Node in the Registry Editor and you should see the newly imported Python node.

You can now run the installers and they’ll find where Python is installed and complete for you.

BTW, you could also import this into HKCM (the node for the Current User) but that only works for that specific user and you might want to do it for all users. If you do choose to go the HKCU route, make sure you edit the path correctly in the .reg file as it needs to be [HKEY_CURRENT_USER\SOFTWARE\Python] not [HKEY_LOCAL_MACHINE\SOFTWARE\Python].

Hope that helps!

2 Comments

  • awesome!!! this is what i looking for... with a 64kernel is more efficient the x64 python compiler-interpreter... but those libraries that are available in win32 installers so i was reading that you needed to install everything x32 including the compiler... this is way better.

  • I found out (the hard way) that PyGTK is 32-bit only, and will not work with 64-bit Python. The PyGTK all-in-one installer doesn't detect the problem either. Solution is to remove PyGTK, remove Python 64-bit, download and install Python 32-bit, re-install PyGTK.

Comments have been disabled for this content.