Friday, December 3, 2010

pyGTK issues on with Python 2.7 , GTK 2.22.0 and Windows 7

I just installed Python, pyGTK, GTK+ on this system, and wrestled with getting Python to load GTK for a couple hours.

Everytime I would open Python and type "import gtk", I would receive the following error:

Traceback (most recent call last):
File "", line 1, in
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line
40, in
from gtk import _gtk
ImportError: DLL load failed: The specified procedure could not be found.
>>>

I could not get past this error until the following:

a) made the GTK runtime bin directory path to the first item in the PATH system variable (maybe something else like GIMP has a GTK dll that isn't compatible)

b) restarted the computer (killing and restarting explorer seems to update the path statement for the session, but not for some applications.)

3 comments:

Anonymous said...

This also works with XP.

Anonymous said...

Could you post some more details of your install process regarding this? For example, what version of pyGTK, cairo and pygobject? I cannot for the life of me get "import gtk" to work properly...any help would be great.

Anonymous said...

also...are you using the all-in-one bundle zip for gtk or the windows exe install? maybe a step by step process.

thanks