Python3 + GTK on Windows (June 2014)

Just in case you’ve read one of the many out of date “how to” guides, and you’re still scratching your head.

HOW TO get Python 3 on a Windows machine ready to start coding with GTK (and a whole bunch of other stuff if you need it).

You will need!

Eclipse IDE either 32 or 64 bit, doesn’t matter. Standard version will do fine.

Python3 32 bit version only folks. At time of writing, it’s 3.4.1

PyGObject (Win32) Which is where GTK is lurking.

Install Python.

Install Eclipse.

In Eclipse, go to “Help > Install New Software”

Where it says “Work with”, type http://pydev.org/updates and hit enter. You should find PyDev in the list below. Tick it and install it.

Now go to “Window > Preferences”, and find “PyDev” in the list. In there, look for “Interpreters > Python Interpreter”. Click “New” and tell it where you just installed your Python.exe.

Eclipse is now ready.

Now run the PyGObject installer. In there you’ll find GTK and all the other bits you’ve been wondering about. If you want the supplied demo to run, you need to include GTKSource, and at the end, when it suggests you downgrade for stability, say “No”. You can say yes here and end up with an earlier version of GTK, but the demo won’t work. Choice is yours.

As far as I can tell, if you mess up the PyGObject install, your best method seems to be uninstall it and try again. It doesn’t seem to like writing back over itself much. YMMV.

Anyway, with any luck that got you to a point where you can start using Python in Eclipse with a bunch of fun libraries to play with.

Now get out there and write that cross platform app you’ve always dreamed of. :)

 
1
Kudos
 
1
Kudos

Now read this

GW2 and Virtual Value

Recently an online game called Guild Wars 2 released an expansion. Somehow it managed to cause a fair bit of anger and dismay for some, while for others it was all perfectly fine and normal. Why? To set the scene, GuildWars2 (GW2), an... Continue →