ImportError: No module named gtk, can not import gettext

Bug #297906 reported by David Konsumer
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
bzr-gedit
Confirmed
Undecided
Unassigned

Bug Description

I have python gtk installed, and all other gedit plugins work, that I have tried.

I get this error on plugin activation:
Traceback (most recent call last):
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/__init__.py", line 81, in <module>
    import dialogs
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/dialogs.py", line 5, in <module>
    from widgets import OptionsBox, TreeChanges
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/widgets.py", line 9, in <module>
    from bzrlib.plugins.gtk import gettext
ImportError: No module named gtk

** (gedit:21632): WARNING **: Cannot load plugin 'bzr' since file '/home/konsumer/.gnome2/gedit/plugins' cannot be read.

** (gedit:21632): WARNING **: Error activating plugin 'Bazaar'

I changed from "from gtk import gettext" to "import gettext" which allowed me to load the plugin.

Then I get this:
/home/konsumer/.gnome2/gedit/plugins/bzr/__init__.py:1858: GtkWarning: gtk_menu_attach_to_widget(): menu already attached to GtkImageMenuItem
  toolbuton.set_menu(menu.get_submenu())
sys:1: Warning: instance of invalid non-instantiatable type `(null)'
sys:1: Warning: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
sys:1: GtkWarning: gtk_menu_detach: assertion `GTK_IS_MENU (menu)' failed
sys:1: Warning: instance with invalid (NULL) class pointer

I try to create a workspace, doesn't work:

Traceback (most recent call last):
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/commands.py", line 385, in <module>
    x = BzrCommands(command, cmds)
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/commands.py", line 40, in __init__
    self.newworkspace()
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/commands.py", line 348, in newworkspace
    dlgnwp = dialogs.BzrNewWorkspace(self.newworkspace_cb)
  File "/home/konsumer/.gnome2/gedit/plugins/bzr/dialogs.py", line 842, in __init__
    gtk.Dialog.__init__(self,_("Create workspace"))
NameError: global name '_' is not defined

Revision history for this message
simpsus (bastian-kennel) wrote :

I have exactly the same problem

Revision history for this message
jMehdi (jmehdi-deactivatedaccount-deactivatedaccount) wrote :

I have solved this issue by doing "sudo apt-get install bzr-gtk"

Revision history for this message
Brian Parma (bj0) wrote :

installing bzr-gtk solved this for me.

this should probably be listed as a dependency somewhere...

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

i confirm this bug,
Traceback (most recent call last):
  File "/home/ovnicraft/.gnome2/gedit/plugins/bzr/__init__.py", line 81, in <module>
    import dialogs
  File "/home/ovnicraft/.gnome2/gedit/plugins/bzr/dialogs.py", line 5, in <module>
    from widgets import OptionsBox, TreeChanges
  File "/home/ovnicraft/.gnome2/gedit/plugins/bzr/widgets.py", line 9, in <module>
    from bzrlib.plugins.gtk import gettext
ImportError: No module named gtk

** (gedit:10631): WARNING **: Error loading plugin 'Bazaar'

Revision history for this message
Guillaume Hain (zedtux) wrote :

I confirm the bug and the work around !
installing bzr-gtk solved this issue !

Guillaume Hain (zedtux)
Changed in bzr-gedit:
status: New → Confirmed
Revision history for this message
Stas Sușcov (sushkov) wrote :

Problem persists with latest gedit on Maverick!

summary: - ImportError: No module named gtk
+ ImportError: No module named gtk, can not import gettext
Revision history for this message
Hibou57 (Yannick Duchêne) (yannick-duchene) wrote :

I have bzr-gtk installed, and this does not solve the case. I am facing the same bug.

Error log:

>>>
Traceback (most recent call last):
  File "/home/yannick/.gnome2/gedit/plugins/bzr/__init__.py", line 81, in <module>
    import dialogs
  File "/home/yannick/.gnome2/gedit/plugins/bzr/dialogs.py", line 5, in <module>
    from widgets import OptionsBox, TreeChanges
  File "/home/yannick/.gnome2/gedit/plugins/bzr/widgets.py", line 9, in <module>
    from bzrlib.plugins.gtk import gettext
ImportError: cannot import name gettext

** (gedit:6252): WARNING **: Error loading plugin 'Bazaar'
<<<

Bazaar configuration:

>>>
Bazaar (bzr) 2.5.0dev2
  Python interpreter: /usr/bin/python 2.6.6
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.31-10-rt-i686-with-Ubuntu-10.10-maverick
  bzrlib: /usr/lib/pymodules/python2.6/bzrlib
  Bazaar configuration: /home/yannick/.bazaar
  Bazaar log file: /home/yannick/.bzr.log
<<<

platform: Ubuntu Maverick (11.04)

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.