我不太理解gi.repository。
我在我的代码中使用了这个构造。
from gi.repository import Gtk
但是如果我想使用一些组件,我会遇到导入错误。
我进行了搜索,并且对于一些组件(如GtkSource、Vte、GLib等),我已经解决了这个问题。
所以我的代码看起来像:
from gi.repository import Gtk, GtkSource, Vte, GLib
一切正常,但如果我想添加matplotlib来在我的画布上绘图,就会出现错误。
enter code/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
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_ascii_strncasecmp: assertion `s2 != NULL' failed
from gtk import _gtk
Segmentation fault (core dumped) here
我该如何让matplotlib与gi.repository一起工作?
谢谢