Active2 years, 8 months ago
I have an application which depends on PyGTK, PyGobject, and PyCairo that I built to work on Linux. I want to port it over to windows, but when I execute
import gobject
I get this:This appears to be caused by the switch from building using MinGW to Microsoft Visual Studio, as documented Python Bug 3308 (
closed: wontfix
).Windows 3.1 GUI executable gvim##w16.zip and gvim##m16.zip These are GUI versions for 16 bit windows (Windows 3.1). The 'w16' has many features, 'm16' has few features (for when you're short on memory). The files ending in '.zip' can be unpacked with any unzip program. Make sure you unpack them all in the same directory! Alternate distributions.
- Building Desktop Applications in PHP with PHP-GTK. You can send any serious questions about PHP-GTK to [email protected], but the questions about PHP-GTK MANUAL should be sent to [email protected]. If you have any question or suggestion for our website you can send them to [email protected].
- Applications developed with Gtk# on.NET do not require Mono to run. If the application is a 100%.NET, without using P/Invoke to call into Win32 functions or using some Windows-specific assemblies, the code will run out of the box on Unix and Linux systems with Mono. The Gtk# installer for.NET can be downloaded from the Downloads page.
Is there any way to install PyGTK/PyGObject in a way that will work with Python 2.6 on Windows, without having to recompile one or the other from source?
lfaraonelfaraone19.3k1515 gold badges4545 silver badges6767 bronze badges
5 Answers
I have it working fine, and it didn't give me much trouble, so we know it can be done...
Keep in mind you will probably need all of the following installed on your Windows machine:
- PyCairo ( http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/ )
- PyGobject ( http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/ )
- PyGTK ( http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/ )Unofficial x64 versions of the above 3 items are available here -- However, I cannot vouch for nor recommend them!and of course
- the GTK+ Runtime ( http://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+/ or http://ftp.gnome.org/pub/GNOME/binaries/win64/gtk+/ )
I suspect in your case that the PyGTK libraries are not finding your GTK+ Runtime directory where the DLLs are. You should have the environment variable GTK_BASEPATH set to the directory of your GTK+ Runtime (usually C:GTK).
Please also see the PyGTK-on-Windows FAQ
Now, if you're trying to compile the PyGTK'ed Python with Py2EXE, that's a bit more complicated, but it can be done as well...
ewallewall![Gtk Download Windows Gtk Download Windows](https://a.fsdn.com/con/app/proj/gtk-mingw/screenshots/gtk3-widget-factory.png)
19.7k1212 gold badges6060 silver badges8383 bronze badges
The PyGTK all-in-one installer has been updated recently:
This will install PyGTK, PyGObject, PyCairo, PyGtkSourceView2, PyGooCanvas, PyRsvg, the gtk+-bundle and Glade. It is absolutely everything necessary to be able to successfully
Steven T. SnyderSteven T. Snyderimport gobject
, import gtk
, etc, without DLL problems.4,10622 gold badges2121 silver badges5353 bronze badges
for 64 bit Windows users see
Above steps will give Invalid DLL error on 64 bit.
digitalPBKdigitalPBK
u should have pygtk,pycairo,pygboject and the gtk+ runtime...
see this for an all in one installerhttp://aruiz.typepad.com/siliconisland/2006/12/allinone_win32_.html
appusajeevappusajeev86422 gold badges1111 silver badges1818 bronze badges
Be careful about installing PyGTK bundle pack if any one planning to run PyGTK through embedded interpreter and the C/C++ code is already using GTK. PyGTK bundle pack does not add its GTK runtime to PATH.
In such case possibly the C code will take GTK from PATH (as probably you have already installed GTK bundle pack) and Python will use separate set of GTK runtime libraries.
Therefore in my case either C GUI or Python GUI used to run properly and used to conflict while running together.
Gtk Runtime
As I use Psychopy as my base python collection, to solve this problem I have just installed PyGTK PyGTK, Pycairo, Pygobject on top of Psychopy.
Gtk Download Windows Xp
Apart from using only one set of GTK runtime I had to initialize GTK in my C code through PyGTK (not by gtk_init (&argc, &argv) in my C code) after initializing python interpreter.
abhijitabhijit