PYTHONPATH, opensuse10.2, gtk not working

Silfheed silfheed at gmail.com
Fri Oct 5 05:31:00 CEST 2007


On Oct 4, 7:39 pm, Steve Holden <st... at holdenweb.com> wrote:
> Silfheed wrote:
> > Heyas
>
> > So I'm trying to do two things, install a little gnome taskbar applet
> > (timer-applet) that was written in python and experiment with writing
> > python gtk apps.  I've installed (through yast) gtk, gtk2, gtk2-devel,
> > python-gtk, python-gtk-devl, python-gtk-doc but I still cant get
> > python to import gtk.  I set PYTHONPATH = /usr/lib/python2.5/site-
> > packages/ and that got importing pygtk to work, but the little app I
> > downloaded wants to import gtk and I just cant figure out what I'm
> > supposed to set PYTHONPATH to in order to get `import gtk` to work.
> > Anyone know what I'm doing wrong or missing?
>
> > Thanks
>
> set PYTHONPATH to /usr/lib/python2.5/lib/site-packages:gtk-root-dir
>
> By the way, do you really think that it's necessary to put site-packages
> on the path? You might find it's already on there as Python starts up.
>
> You can tell by printing sys.path from Python.

Yes, it actually requires adding the site-packages to the PYTHONPATH
to get pygtk to work.  So far I've managed to get gtk to give a
different error when I added the site-packages/gtk-2.0/ directory (the
only gtk-like thing in the site-packages) to the PYTHONPATH
`ImportError: gobject/_gobject.so: undefined symbol:
PyUnicodeUCS4_FromObject`.   I'll have to check the path when I get
home to see what it actually has within it and work from there.

Thanks.




More information about the Python-list mailing list