06 September 2009

PyGTK 2.16.0 Win32 Unofficial Build

Looking for PyGTK installer? go here (official)

This page is obsolete!  updated here (complete installer)

Update 14 August 2010:
- Experimental PyGTK 2.21.0 Build

Update 6 July 2010:
-Move webkit, clutter and poppler from this page
-Bundling runtime all in one 
-Add pygtkhtml2, a lightweight html browser which good enough for embedded help viewer

Update 3 July 2010:
-I will start rebuild and update the whole packages this weekend, hopefully compatible with the official GTK-2.20. And thanks to Jendrik S. for pointing issue with my GTK build 

Update 1 May 2010:
-Bundling Gstreamer into single packages updated to 0.10.29
-fix gst-ffmpeg compile issue (now play all supported content)
-fix gstreamer (gstregistry.c) so it will look for lib\gstreamer-0.10 for plugins correctly without the need of defining GST_PLUGINS_PATH. When not modified gstreamer seems to find the folder but didn't load it. Update x264 and Lame to recent version.
-Apparently webinspector module in Webkitgtk-1.2.0 is hardcoded to C:\Programs\gtkmm (My compile prefix). I don't know the correct workaround but webkit always try "\Webcore\Inspector\front-end" before
the absolute path, so the easy fix is copy "\share\webkit-1.0\webinspector" as "\Webcore\Inspector\front-end" and put all executable in "bin" outside.

Update 26 April 2010:
(python 2.6 win32 binaries, optimized for pentium 3. All python binaries are built from vanilla source with some minor patch for building process itself, C runtime built from opensuse dist's source. Compiler is GCC 4.4 MinGW)

Download binaries for Python 2.6:
PyGTK-2.16.0 (build with Numpy support)
PyGTKGLExt-1.1.0 + PyOpenGL
GTK-2.16.6 Bundle with Glade 5.1 Mb (updated July 29, 2010)

Gstreamer-0.10.29 Bundle 6.5 Mb (including  plugins base, good, bad, ugly, ffmpeg & gl; need GTK above)
jack-audio-1.9.5 (optional)

How to install? 
The 7zip archives is relative to installation target, if you installing python package then simply extract it to your python folder aka C:\Python26. 
For Runtime DLL there is some options: 1. Create a reasonable named folder, extract everything you need there and add them to "PATH" of Environment variable 2. Bring your python files to the same folder where you extract runtime archives.

- About GST Plugins: mostly plugins that need ext. deps. are build statically linked. Need more plugins?
- About why no installer: this is unofficial, I recommend to use Python Portable instead.
- Demo? [python] [Gstreamer binary only
- Docs? Googling for their official site or better more download the source package

- Encounter glib import error? please update your Glib to late 2.23.x or the latest 2.24, there is API changes that break every newly compiled programs when used in older glib. Or download GTK bundle above.
- Still not working? that's said it's unofficial, NEVER report it to official bugtracker or else. You can ask me though as I also learning python.
- More dictionaries? Enchant packages above (GTK bundle) came with english myspell interface also popularly known as OpenOffice Dict. Googling them and put it in share/enchant/myspell.

- Want more theme to pimp your overall programs interface? 50 themes of my favorite

Other interesting tool for PyGTK development:
Glade Newer Glade need GTK >= 2.18 which is simply buggy


  1. Hi, when I try to install pygtk package it show an error:

    Traceback (most recent call last):
    File "string", line 101, in module
    File "(string)", line 49, in html_fixxref
    AttributeError: 'module' object has no attribute 'DOCDIR'
    *** run_installscript: internal error 0xFFFFFFFF ***

    Then i click on finish and it seems to be ready for use, but when i run pygtk apps, windows show me an error,

    "...libpyglib-2.0-python-0.dll not found...".




  2. Hi Dario, thank for testing further. I think I forgot to NOT rename that file (Python\Lib\site-packages\gtk-2.0\glib\libpyglib-2.0-python-0.pyd)
    when create installer. Try to rename it as libpyglib-2.0-python-0.dll

    About DOCDIR, I will try figure out and upload again. But its not critical error btw,

  3. Thanks for reply, I already solved the problem myself renaming that lib as you said.

    I tested the whole toolkit running fine and without a single error several programs (three of them are very complex) I developed for my company.

    Thanks again for your work.


  4. Hi, sorry, can you create a pywebkitgtk win32 py2.5 version? I need but i can't compile and build. Thanks.

  5. Hi M3nt0r3
    Actually I do this just for my interest and especially because MyPaint need PyGTK as dependencies and because I'm the Windows build maintainer. So I can't promise you...

  6. I'm trying to run Python programs that use GTK with Python 2.6 on a Windows machine, so your post was exactly what I was looking for.

    I installed your:

    And it fixed some errors, notably the "type_from_name" error. However, I got a new error.

    It gets all the way to glib, but then it searches for glib._glib and breaks.
    site-packages\gtk-2.0\glib\_glib.pyd exists (I think put there by your win32 apps), which I find confusing. From my understanding, the file it needs is there but it's not in the search list somehow.

    What do you think?

    ---------- Capture Output ----------
    > "C:\Python26\python.exe" multipleplots2.py
    Traceback (most recent call last):
    File "multipleplots2.py", line 4, in [module]
    import pygtk, gtk
    File "C:\Python26\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in [module]
    import gobject as _gobject
    File "C:\Python26\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26, in [module]
    from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
    File "C:\Python26\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in [module]
    from glib._glib import *
    ImportError: DLL load failed: The specified module could not be found.
    > Terminated with exit code 1.

  7. I think I ever seen that problem before. But I need more clue about it. In my PC it runs fine, can you try in verbose mode:


    and watch where in break (wrong search path?)

    or you may also use systernals filemon, to know why it can't find the dependencies.

    and have you put libffi-5.dll in your GTK's bin folder?

  8. that's libffi deps. is annoying thanks for recompile it without.

  9. Hi,

    I put all of the dlls in here.
    I also added this to the PATH.

    echo %PATH% shows this.

    I also create the environment variable
    in Enviroment Variables->System Variables

    When I 'import webkit' the following happens.

    >>> import webkit

    import webkit # directory C:\Python26\lib\site-packages\webkit
    # C:\Python26\lib\site-packages\webkit\__init__.pyc matches C:\Python26\lib\site
    import webkit # precompiled from C:\Python26\lib\site-packages\webkit\__init__.p
    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python26\lib\site-packages\webkit\__init__.py", line 19, in
    import webkit
    ImportError: DLL load failed: The specified module could not be found.

    What am I doing wrong?

    Thank you.

    Andre Mikulec

  10. Umm.. webkit is kind of wired :(
    If you on XP please investigate what missing by using sysinternals filemon (the older version is better)
    or if you have depends.exe (in resource toolkit installer on XP CD IIRC) (try run> depends)
    if you have it,
    Once in dependency walker, load pythonw.exe then start profiling dialog, in argument box, fill it with you script filename. Start it..
    When it start, depends will show you what file missing...
    Sorry to give you another problems, I'm thinking of making installer a couple of time (aware that this kind of problem will arise) but It's too huge and wired :)


  11. Hi, Tumagonx! Can you show me the sample directory-tree after installation-unpacking 7z? Because I cann't understand you: for example, gtk- unpacking create directories: bin, etc, lib, share. Where have I put them - in C:\Python26?

  12. "2. Bring them all at the same folder of your python files"
    Sorry.. what I mean with "your python files" is the python scripts you're develop not mixing it in C:\Python26. Merely mean: your .py files must in bin folder or take it out (from bin)

    extract all runtime dlls in C:\gtk
    then put py files in bin

    C:\Gtk\bin--> dlls and py

    or take it out from bin:
    C:\Gtk--> dlls and py
    C:\Gtk\bin--> deleted

    or if you place your script in for ex. D:\scripts
    first extract runtime dlls there. then moved all files inside bin out so it resemble directory tree before.

    D:\script->dlls and py files
    D:\script\bin deleted