适用于Windows 7的Python GObject Introspection

时间:2015-10-22 11:48:46

标签: python windows matplotlib gobject gobject-introspection

我正在尝试在Python中使用matplotlib,但任何导入都会失败并出现以下错误:

from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\matplotlib\backends\backend_gtk3cairo.py", line 6, in <module> 
from . import backend_gtk3
  File "C:\Python27\lib\site-packages\matplotlib\backends\backend_gtk3.py", line 21, in <module>
    "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
ImportError: Gtk3 backend requires the GObject introspection bindings for Gtk 3 to be installed.

应用程序需要能够在Windows机器上运行。有人对此有任何支持吗?

我发现很多旧线程都说不可能在Windows上使用GTK3和Python,但它们至少有2到3年的历史。所以事情可能会发生变化。

1 个答案:

答案 0 :(得分:1)

使用http://sourceforge.net/projects/pygobjectwin32/files/pygi-aio-3.14.0_rev22-setup.exe中的pygi-aio安装程序解决并卸载任何其他旧的依赖项(GTK2,pygobject等)