Package: pygtk
Severity: important

Applications using pygtk fail to import gtk after doing
import pygtk
pygtk.require('2.0').
The actual error is
[EMAIL PROTECTED]:~$ python
Python 2.3.5 (#2, Nov 20 2005, 16:40:39)
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
>>> pygtk.require('2.0')
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  ImportError: No module named gtk

The problem seems to be related to pygtk.py first removing any pygtk
dirs on lines 77-79 in pygtk.require and then prepending paths in
_get_available_version(). Before calling pygtk.require('2.0') sys.path
looks like
>>> import sys;print sys.path
['', '/usr/lib/python23.zip', '/usr/lib/python2.3',
'/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk',
'/usr/lib/python2.3/lib-dynload',
'/usr/local/lib/python2.3/site-packages',
'/usr/lib/python2.3/site-packages',
'/usr/lib/python2.3/site-packages/Numeric',
'/usr/lib/python2.3/site-packages/PIL',
'/usr/lib/python2.3/site-packages/cairo',
'/usr/lib/python2.3/site-packages/gtk-2.0'],

but after require() it becomes
>>> pygtk.require('2.0')
>>> import sys;print sys.path
['/usr/local/lib/python2.3/site-packages/gtk-2.0', '',
'/usr/lib/python23.zip', '/usr/lib/python2.3',
'/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk',
'/usr/lib/python2.3/lib-dynload',
'/usr/local/lib/python2.3/site-packages',
'/usr/lib/python2.3/site-packages',
'/usr/lib/python2.3/site-packages/Numeric',
'/usr/lib/python2.3/site-packages/PIL',
'/usr/lib/python2.3/site-packages/cairo'].

I recently installed a package in /usr/local (leaftag:
http://www.chipx86.com/wiki/Leaftag), but pygtk shouldn't ignore any
other gtk-2.0 directories, namely
/usr/lib/python2.3/site-packages/gtk-2.0, because of this. Is this
behaviour intended and leaftag shouldn't install itself in
/usr/local/lib/python2.3/site-packages/gtk-2.0?

Greetings,
Matthias

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15.4
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to