Try launching it with 'python -v -v'. It'll print debugging output for loading modules, including what it's trying to find where. It may help you track down why one fails while the other succeeds.
April 28, 2008 at 4:32 PM
Anonymous said...
seems like you're using a debian sid because of your python2.4 version 2.4.5. 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
April 28, 2008 at 4:44 PM
Anonymous said...
What is the contents of your sys.path before and after running pygtk.require(2.0) ? In both cases there should be '/var/lib/python-support/python2.5/gtk-2.0' which is the place where the gtk module is to be found.
April 29, 2008 at 6:53 AM
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:
"whats wrong with my python setup?"
4 Comments -
Verify that there is no "gtk" in your PYTHONPATH, and verify that there is no directory named "gtk" in your "."!
Have a nice day,
Laurent
April 28, 2008 at 2:53 PM
Try launching it with 'python -v -v'. It'll print debugging output for loading modules, including what it's trying to find where. It may help you track down why one fails while the other succeeds.
April 28, 2008 at 4:32 PM
seems like you're using a debian sid because of your python2.4 version 2.4.5.
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
April 28, 2008 at 4:44 PM
What is the contents of your sys.path before and after running pygtk.require(2.0) ? In both cases there should be '/var/lib/python-support/python2.5/gtk-2.0' which is the place where the gtk module is to be found.
April 29, 2008 at 6:53 AM