What is wrong with my Windows GTK+ for Python installation?
Getting pretty frustrated with this. I installed pygtk 2.24, pycairo 1.8.10, and pyobject 2.28.3 all for my 32 bit system and my installed Python version of 2.7. I have GTK+ installed and working.
Also, I have the path to "C:\Python27\Lib\site-packages\gtk-2.0" set in sys.path (where pygtk and pobject reside) and my Path system variable for GTK_BASEPATH is set to C:\gtk, where GTK+ resides.
I get this error when I attempt to import gtk:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-package开发者_JAVA百科s\gtk-2.0\gtk\__init__.py", line 30, in <module>
import gobject as _gobject
File "C:\Python27\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:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in <module>
from glib._glib import *
ImportError: DLL load failed: The specified procedure could not be found.
I can't figure out what's wrong. Anyone have any ideas?
EDIT
Found this post, and I found a variable for GtkSharp (don't know where it came from) but removing it did not help.
Try uninstalling all of that (including GTK+, unless something else needs it) and use the PyGTK all-in-one installer instead.
If you're compiling your own, make sure you go in the 'dist' folder and run the created installer to use your version on your machine.
Windows compilation directions:
http://git.gnome.org/browse/pygtk/tree/README.win32
精彩评论