[pygtk] Installing PyGTK on Windows?

Stephen George steve_geo at optusnet.com.au
Thu Jul 29 17:32:52 WST 2010


  On 28/07/2010 4:26 AM, Smartboy wrote:
> Hello,
>
> Has anyone here ever successfully installed a recent version of PyGTK
> on Windows successfully?

Yes, I've sucessfully installed but it can be difficult on some systems.

>   If anyone else has gotten around this, then
> would you mind putting the steps you used since I can't find any other
> ways to get it working.

As John has asked, we need more info on the versions you are trying to 
install on.

I guess from your description your getting a similar output as the 
second example

 From the command prompt,  start the python
interpreter and try to import gtk

C:\>
C:\>
C:\>c:\Python26\python.exe
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
  >>>
  >>>  import gtk
  >>>
Expect the import gtk to take some seconds, then it just returns you to
the prompt if all OK.


Or do you get a traceback similar to this

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


1) I had a similar error on a XP 32bit machine. I solved it by
installing Microsoft Visual C++ redist for 2008 SP1
http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en



2) On a windows 2000 machine I had a similar error when the GTK runtime
bin path was not in the environments path.

     Maybe you should check your GTK runtime is in the path.

Each time you perform one of these actions you may need to close down the command prompt and create a new one, esp. adding the path to environment will need a new command prompt to see the new path.


Until you get 'import gtk' working from the python interpreter, you cannot prodceed further


Some time ago I was playing with a little script to try and detect 
common  GTK/pyGTK install problems (on windows), it never really got 
finished.
Would be interested if running the script helps at all in detecting the 
source of your problem.

I've only tested on WinXP 32 bit system, don't know if it will work on 
other systems.

Script needs to be run from a command window.

Any suggestions how to improve the script (or bug fixes) would be 
gratefully accepted.

good luck.

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_gtk_install.py
Type: text/x-python
Size: 12763 bytes
Desc: not available
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20100729/6789d48e/attachment.py>


More information about the pygtk mailing list