Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to integrate my Python/GTK3 app with Ubuntu's messaging menu and every time I try to import "indicate" (python-indicate) my app crashes, with the following traceback:

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk

This looks like some sort of clash between GTK2 and GTK3... anyway, how would I go about fixing this?

Thanks.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Use

from gi.repository import Indicate

instead of

import indicate
share|improve this answer
    
Thanks, that looks like it's working :) –  aviraldg Jun 18 '12 at 18:13
    
Also check out the PyGI example on developer.ubuntu.com/resources/technologies/… –  David Planella Jun 19 '12 at 6:05
    
the same thing for vte module: from gi.repository import Vte –  int_ua Jun 20 '12 at 9:56
    
Same for importing Gdk, GLib, Pango, GdkPixbuf and GObject from gi.repository instead of their older alternatives. It seems it's impossible to import GTK2 and GTK3 at the same time. –  NoBugs Oct 27 '12 at 18:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.