[EXC]No module named gtk

Bug #30514 reported by meba
14
Affects Status Importance Assigned to Milestone
pygtk (Ubuntu)
Fix Released
High
Ubuntu Desktop Bugs

Bug Description

Hi,
gdesklets and other applications are not working on my desktop due to missing GTK module for python:
[EXC]No module named gtk
in /usr/lib/gdesklets/gdesklets-daemon: line 127 ?
in /usr/lib/gdesklets/gdesklets-daemon: line 108 _gdesklets_main
in /usr/lib/gdesklets/main/__init__.py: line 115 init
in /usr/lib/gdesklets/utils/ErrorFormatter.py: line 123 _new_imp
[EXC]/usr/lib/gdesklets/utils/ErrorFormatter.py

But the strange thing is, that i have python-gtk installed:
root@arkeia:/home/jimmy# dpkg -l | grep python | grep gtk
ii python-gtk-1.2 0.6.12-4ubuntu1 GTK support module for Python
ii python-gtk2 2.8.4-0ubuntu1 Python bindings for the GTK+ widget set
ii python-gtk2-dev 2.8.4-0ubuntu1 GTK+ bindings: devel files
ii python-gtkextra 0.22-6ubuntu1 Python module for the GtkExtra widget set exii python-gtkmvc 0.9.2-1ubuntu1 Model-View-Controller (MVC) implementation fii python2.4-gtk2 2.8.4-0ubuntu1 Python bindings for the GTK+ widget set

This bug is present in DapperDrake as in Breezy, don't know how to handle it. Any suggestions?

Revision history for this message
meba (jakub-rtfm) wrote :

Oh, i just found bude #28731 which seems as fixed duplicate of this. But i don't see any package named pygobject in my Dapper?

Revision history for this message
Sebastien Bacher (seb128) wrote :

the package is python2.4-gobject and python2.4-gtk2 Depends on it

Revision history for this message
meba (jakub-rtfm) wrote : My python packages

I am attaching list of python packages installed on my system. python2.4-gobject and python2.4-gtk is included, but bug is still present

Revision history for this message
Sebastien Bacher (seb128) wrote :

That's not the same bug as #28731 which was about "pygtk" not found

Could you run "python -c "import sys; print sys.path"" and copy that to a comment? Do you change your PYTHONPATH or install stuff to /usr/share/local by example?

Changed in pygtk:
status: Unconfirmed → Needs Info
Revision history for this message
meba (jakub-rtfm) wrote :

['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/HTMLgen', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/cairo', '/usr/lib/python2.4/site-packages/gtk-2.0']

I did not change pythonpath at all

Revision history for this message
Sebastien Bacher (seb128) wrote :

What about "ls /usr/lib/python2.4/site-packages/gtk-2.0/gtk" and "strace -e open python -c "import gtk" 2>&1 | grep gtk.so"?

Revision history for this message
meba (jakub-rtfm) wrote :

root@arkeia:/home/jimmy# ls /usr/lib/python2.4/site-packages/gtk-2.0/gtk
compat.py compat.pyo glade.so _gtk.so __init__.pyc keysyms.py keysyms.pyo
compat.pyc glade.la _gtk.la __init__.py __init__.pyo keysyms.pyc
root@arkeia:/home/jimmy#

open("gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python24.zip/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/plat-linux2/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/lib-tk/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/lib-dynload/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.4/site-packages/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/HTMLgen/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/Numeric/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/PIL/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/cairo/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", O_RDONLY|O_LARGEFILE) = 4
open("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", O_RDONLY) = 5

Thank you, for your concern

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for replying to the comment, according to
"open("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", O_RDONLY) = 5" the "import gtk" works fine. With what application do you have the issue? Do you run those commands with the same user as the application? Could you try running "strace -e open <an_application_for_which_one_you_have_the_bug> 2>&1 | grep gtk.so"?

Revision history for this message
meba (jakub-rtfm) wrote :

grep gtk.so returns nothing, but i am attaching complete strace of gdesklets

Revision history for this message
meba (jakub-rtfm) wrote : Gdesklets strace

strace of gdesklets. ran as user jimmy, same as previous commands

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you do the same with strace -f -e open ... ?

Revision history for this message
meba (jakub-rtfm) wrote : Another strace

jimmy@arkeia:~$ strace -f -e open -o strace2 gdesklets

Revision history for this message
meba (jakub-rtfm) wrote :

Just attaching the strace from 2006-02-06 18:02:45 UTC, because that one was ran as root. (But the result is the same...)

jimmy@arkeia:~$ strace -e open python -c "import gtk" 2>&1 | grep gtk.so
open("gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python24.zip/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/plat-linux2/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/lib-tk/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/lib-dynload/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.4/site-packages/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/HTMLgen/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/Numeric/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/PIL/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/cairo/gtk.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", O_RDONLY|O_LARGEFILE) = 4
open("/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so", O_RDONLY) = 5

Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

It appears that I have this bug in ubuntu dapper (upgraded from breezy).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Is that specific to gdesklets? That strace indicates that gtk is loaded correctly

Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

I get the same straces and I don't even have gdesklets installed, so no.

Programs like Update Manager also crash with this error.
Also: if the line pygtk.require("2.0") is removed, programs with this error will work, I have discovered - if that helps.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you run "ls /usr/lib/python2.4/site-packages/pygtk* -l" and copy that to a comment?

Michael, do you have an idea on that?

Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

Here's what I get:

-rw-r--r-- 1 root root 8 2006-01-17 13:45 /usr/lib/python2.4/site-packages/pygtk.pth
-rw-r--r-- 1 root root 2619 2006-01-17 13:45 /usr/lib/python2.4/site-packages/pygtk.py
-rw-r--r-- 1 root root 1603 2006-02-14 15:41 /usr/lib/python2.4/site-packages/pygtk.pyc
-rw-r--r-- 1 root root 1322 2006-02-14 11:51 /usr/lib/python2.4/site-packages/pygtk.pyo
-rw-r--r-- 1 root root 2469 2005-11-27 19:48 /usr/lib/python2.4/site-packages/pygtk.py.python-gtk-1.2

Revision history for this message
Sebastien Bacher (seb128) wrote :

What about "ls /etc/alternatives/py* -l"?

Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

Here:

lrwxrwxrwx 1 root root 56 2006-02-16 16:04 /etc/alternatives/py2.4gtk.py -> /usr/lib/python2.4/site-packages/pygtk.py.python-gtk-1.2

Revision history for this message
Sebastien Bacher (seb128) wrote :

The alternative didn't get cleaned on upgrade. Does that update fixes your issue?

 pygtk (2.8.4-0ubuntu3) dapper; urgency=low
 .
   * debian/python2.4-gtk2.preinst:
     - clean the pygtk1.2 alternative too (Ubuntu: #30514)

Changed in pygtk:
assignee: nobody → desktop-bugs
Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

Unfortunately not. Here's a sample error message I get at the moment:

joseph@sys1101:~$ sudo update-manager
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 28, in ?
    import gtk
ImportError: No module named gtk

Revision history for this message
Sebastien Bacher (seb128) wrote :

Michael, do you have any idea about that?

Changed in pygtk:
status: Needs Info → Unconfirmed
Revision history for this message
Anthony Turner (mzxgiant) wrote :

I'm having the same problem (and getting the same results from the commands your requested output from)

Revision history for this message
Joseph Seaton (greenpenguin-mailing) wrote :

This bug has dissapeared (for me at least) in a recent update. Everything Python works fine :).

Revision history for this message
Barry deFreese (bddebian) wrote :

So has this been resolved for everyone? Thank you.

Changed in pygtk:
status: Unconfirmed → Needs Info
Revision history for this message
Sebastien Bacher (seb128) wrote :

does anybody still has that issue with dapper?

Revision history for this message
Barry deFreese (bddebian) wrote :

Fixed in Dapper. Thank you.

Changed in pygtk:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.