473,471 Members | 4,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GTK import doesn't import first time

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 (mh******@skippinet.com.au)
- 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
Jul 18 '05 #1
2 8637
>>>>> "Dennis" == Dennis <ds******@adelphia.net> 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

Jul 18 '05 #2
John Hunter <jd******@ace.bsd.uchicago.edu> wrote in message news:<ma*********************************@python.o rg>...
>> "Dennis" == Dennis <ds******@adelphia.net> 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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rene | last post by:
I'm trying to learn how to use python for cgi scripts... I created a form that submits some info that I put in a cookie. Then the script calls itself and reads the cookie, and displays a...
4
by: Olivier Noblanc ATOUSOFT | last post by:
Hello, In the botom of this post you will see my source code. The problem is when i launch main.py that doesn't make anything why ? Thanks olivier noblanc Atousoft...
2
by: Rob R. Ainscough | last post by:
I have an interesting problem that is either a bug or just some local issue with my PC (probably the later). If I place my cursor on a word and hit F1 for help, it goes thru a process (see a...
16
by: TB | last post by:
Hi all: If you think that the following comments are absolute amateurish, then please bear with me, or simply skip this thread. A couple of months back I made the decision to initiate a...
1
by: TS | last post by:
I have a page that executes a method that takes a long time and i have an iframe that displays an progress bar animated gif while the page is running. The first time you hit it, it doesn't animate....
3
by: Chad Miller | last post by:
Why doesn't the listview columns resize automatically after the first time the listview is populated. Or if you run the sub twice. Private Sub LoadLV lvProjects.SuspendLayout()...
2
by: Patrick Jox | last post by:
Hi, I have am using ObjectDataSource and GridView to display data on my ASP.NET webform. I also implemented a comparer class to be able to sort the data by clicking on the column header. My...
2
by: rsdev | last post by:
Hi, I am dynamically creating controls as part of a paging system for a grid view in an updatepanel. I have attached a CommandEventHandler to the control. So far so good! But when a click...
30
by: fuchsia555 | last post by:
Is there code to auto reload images if it doesn't load at first time in users browser ?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.