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.

How to install libSBML in Fedora 18 with Python bindings

Install compiler
yum install gcc-c++
yum groupinstall "Development Tools"

Install some additional packages if needed
yum install python-devel
yum install libxml2-devel
yum install swig

Compile and install libSBML
Go to the directory where you have exctracted libsbml source and run these 3 commands
./configure --with-python
make
make install

Make libsbml accessible to Python
export PYTHONPATH=/usr/local/lib64/python2.7/site-packages/libsbml
Or fix the path right from your python script
import sys
sys.path.append('/usr/local/lib64/python2.7/site-packages/libsbml')

You can get and set environment variables via os.environ:
import os
os.environ['PYTHONPATH'] = '/usr/local/lib/python2.7/dist-packages/libsbml'

But since your interpreter already runs, this will have no effect.

For whatever reason, in Fedora the library file is _libsbml, not libsml. To use libsbml in Fedora import it like this:
import _libsbml