2013-04-30

gtk import Segmentation fault

When I tried to run my program (ModeRator) I get this error:

/usr/lib64/python2.7/site-packages/gobject/constants.py:24:
Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib64/python2.7/site-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/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40:
Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Segmentation fault (core dumped)

I 'fixed' the problem by disabling the import of matplotlib

It turns out that it is possible to import only one of them:

from gi.repository import GObject, Gtk

or

import matplotlib.pyplot as plt

Comment out one of these lines end the error is gone! Better explanation of problems like this is found here: http://blog.rabbitvcs.org/archives/312.