whats wrong with my python setup?
Can any python guru out there explain whats going on here:
$ /usr/bin/gnome-about
Traceback (most recent call last):
File "/usr/bin/gnome-about", line 35, in ?
import gtk
ImportError: No module named gtk
$ head -n 1 /usr/bin/gnome-about
#!/usr/bin/python
$ head -n 36 /usr/bin/gnome-about|tail -n +29
import pygtk
pygtk.require ('2.0')
import gobject
from gobject.option import OptionParser, make_option
import gtk
$ /usr/bin/python
Python 2.4.5 (#2, Mar 12 2008, 00:15:51)
[GCC 4.2.3 (Debian 4.2.3-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
>>> import gtk
>>>
$ /usr/bin/python
Python 2.4.5 (#2, Mar 12 2008, 00:15:51)
[GCC 4.2.3 (Debian 4.2.3-2)] 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 "", line 1, in ?
ImportError: No module named gtk
>>>
UPDATE: Thanks to Karl-Lattimer, the problem was solved by:
# rm /usr/bin/python
# ln -s /usr/bin/python2.5 /usr/bin/python
$ /usr/bin/gnome-about
Traceback (most recent call last):
File "/usr/bin/gnome-about", line 35, in ?
import gtk
ImportError: No module named gtk
$ head -n 1 /usr/bin/gnome-about
#!/usr/bin/python
$ head -n 36 /usr/bin/gnome-about|tail -n +29
import pygtk
pygtk.require ('2.0')
import gobject
from gobject.option import OptionParser, make_option
import gtk
$ /usr/bin/python
Python 2.4.5 (#2, Mar 12 2008, 00:15:51)
[GCC 4.2.3 (Debian 4.2.3-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
>>> import gtk
>>>
$ /usr/bin/python
Python 2.4.5 (#2, Mar 12 2008, 00:15:51)
[GCC 4.2.3 (Debian 4.2.3-2)] 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 "
ImportError: No module named gtk
>>>
UPDATE: Thanks to Karl-Lattimer, the problem was solved by:
# rm /usr/bin/python
# ln -s /usr/bin/python2.5 /usr/bin/python
Comments
Have a nice day,
Laurent
in a recent sid installation the default python version is already 2.5.2, so I'm pretty sure an 'apt-get update && apt-get dist-upgrade' will help you.
otherwise try to reinstall python-gtk2 and try to locate the _gtk.so files via 'dpkg -L python-gtk2|grep gtk\.so'
so long
:wq buz