Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > GTK import doesn't import first time

Reply
Thread Tools

GTK import doesn't import first time

 
 
Dennis
Guest
Posts: n/a
 
      08-18-2003
The setup:

Windows XP Pro
Python 2.3
GTK+ 2.2.1.2 and pyGTK 1.99.17 for Python 2.3 from
http://www.pcpm.ucl.ac.be/~gustin/win32_ports/

I've downloaded and installed per the instructions the pyGTK and GTK+
for win32 from the above locations. Folowing the instructions, I
import pygtk first, run pygtk.require('2.0') second and then import
gtk. I receive an error on the import gtk the first time, but
immediately after, if I import again it works. Even if I don't
impo0rt pyGTK at all and only import gtk, I get the same results. Any
ideas?

PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)]
on win32.
Portions Copyright 1994-2001 Mark Hammond ((E-Mail Removed))
- see 'Help/About PythonWin' for further copyright information.
>>> import pygtk
>>> pygtk.require('2.0')
>>> import gtk

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "D:\Python\Python23\lib\site-packages\gtk-2.0\gtk\__init__.py",
line 43, in ?
from _gtk import *
ImportError: DLL load failed: The specified procedure could not be
found.
>>> import gtk
>>>


Thanks,
Dennis
 
Reply With Quote
 
 
 
 
John Hunter
Guest
Posts: n/a
 
      08-18-2003
>>>>> "Dennis" == Dennis <(E-Mail Removed)> writes:

Dennis> I've downloaded and installed per the instructions the
Dennis> pyGTK and GTK+ for win32 from the above locations.
Dennis> Folowing the instructions, I import pygtk first, run
Dennis> pygtk.require('2.0') second and then import gtk. I
Dennis> receive an error on the import gtk the first time, but
Dennis> immediately after, if I import again it works. Even if I
Dennis> don't impo0rt pyGTK at all and only import gtk, I get the
Dennis> same results. Any ideas?

The reason it "works" the second time is that it doesn't try and
import it again after the first. So it did not really work.

Did you download and install the GTK runtime from
http://www.dropline.net/gtk? If you installed it to to C:\GTK, you'll
need C:\GTK\bin and C:\GTK\lib in your path.

John Hunter

 
Reply With Quote
 
 
 
 
Dennis
Guest
Posts: n/a
 
      08-18-2003
John Hunter <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> >>>>> "Dennis" == Dennis <(E-Mail Removed)> writes:

>
> Dennis> I've downloaded and installed per the instructions the
> Dennis> pyGTK and GTK+ for win32 from the above locations.
> Dennis> Folowing the instructions, I import pygtk first, run
> Dennis> pygtk.require('2.0') second and then import gtk. I
> Dennis> receive an error on the import gtk the first time, but
> Dennis> immediately after, if I import again it works. Even if I
> Dennis> don't impo0rt pyGTK at all and only import gtk, I get the
> Dennis> same results. Any ideas?
>
> The reason it "works" the second time is that it doesn't try and
> import it again after the first. So it did not really work.
>
> Did you download and install the GTK runtime from
> http://www.dropline.net/gtk? If you installed it to to C:\GTK, you'll
> need C:\GTK\bin and C:\GTK\lib in your path.


Yes, as stated in the post I installed GTK runtime. Also, GTK\2.0 is
in my path and verified with:

>>> import os
>>> print '\n'.join(os.environ['PATH'].split(';'))


which provided (amongst other entiries)
....
D:\GTK\2.0\lib
D:\GTK\2.0\bin
....

BUT, searching around google a little more I notice that a LOT of
people have had this problem and the response you've provided is
pretty much the same. Then I found an answer that worked here:

http://www.daa.com.au/pipermail/pygt...ry/004329.html
(THANKS Jamey!)

Seems that previous versions installed the dll in C:\windows\system32
and python was finding the old dll since the windows directory is
earlier in the path. Had I remembered (or known - don't know which)
that the directory GTK installs dll's in is now different, I would
have caught this. D'oh! Removed the old dll and all is well.

Dennis S.
>
> John Hunter

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby GTK Fortune Cookies (gtk-fortune-0.1.1) Alex Shulgin Ruby 1 11-21-2007 01:05 AM
GTK+, segmentation fault in gtK-editable_get_chars zombek@gmail.com C Programming 2 05-29-2007 03:27 PM
'could not open display' error when import gtk - how fix? seberino@spawar.navy.mil Python 2 02-15-2006 02:49 PM
Python GTK import error Douglas Soares de Andrade Python 5 11-30-2004 10:01 AM
compiling ruby under windows (+ gtk stuff, is the gtk list dead?) Gergely Kontra Ruby 2 06-18-2004 10:20 PM



Advertisments