[pygtk] [newbie] path problem winxp

Simone Borselli simone_borselli at tin.it
Thu Aug 5 04:19:26 WST 2004


Hi all,
I'm afraid I'll be a bit verbose, cause of my rusty english and my 
newbie-state.  Hope you'll excuse me.
I'm running python2.3.4 on winxp.  All runs well,  my scripts work (as 
long I provide the right code .

I installed GTKv2 and glade from the all in one file 
(gtk-win32-aio-2.4-rc11.exe) downloaded from gladewin32.sourceforge.net
Then i Installed PyGTK (pygtk-2.2.0-1.win32-py2.3.exe) (I tried with the 
2.3.94 unstable)

To try if all went ok i saved the helloworld.py example script found in 
the tutorial of pygtk.org

My file's name is hellogtk.py, the code is as follows (i deleted only 
comments for brevity)

import gtk

class HelloWorld:
   def hello(self, widget, data=None):
       print "Hello World!"

   def delete_event(self, widget, event, data=None):
       print "delete event occurred"

       return gtk.FALSE

   def destroy(self, widget, data=None):
       gtk.main_quit()

   def __init__(self):
       self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
       self.window.connect("delete_event", self.delete_event)
       self.window.connect("destroy", self.destroy)
       self.window.set_border_width(10)
       self.button = gtk.Button("Hello World")
       self.button.connect("clicked", self.hello, None)
       self.button.connect_object("clicked", gtk.Widget.destroy, 
self.window)
       self.window.add(self.button)
       self.button.show()
       self.window.show()

   def main(self):
       gtk.main()

if __name__ == "__main__":
   hello = HelloWorld()
   hello.main()

tryng to run it i get this error:
You need to install PyGTK or GTKv2 or set your PYTHONPATH correctly.
try: export PYTHONPATH=  /usr/local/lib/python2.2/site-packages/

I've been searching on google and asking in newsgroups and chats for 2 
days and i could manage this.
This search was useful to understand that the code is ok (tried on 
another machine by a user of a newsgroup), and that I have really 
installed GTKv2 ("import gtk"  doesn't give any error back)

The path where python is:  C:\Python23
The path were GTK is: C:\GTK

My path variable (as in start ->right click on My computer-> properties 
-> tab advanced -> environmental variable) is:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;                                              
\
C:\PROGRA~1\FILECO~1\Odbc\FILEMA~1;C:\GTK\bin;C:GTK\lib;C:\Perl\bin\;C:\Python23\Lib\site-packages 


My face is starting looking like a question dot....

If I didn't provide enough info please ask me, consider I'm a newbie.
Thank you for your attention
Simone Borselli



More information about the pygtk mailing list