【发布时间】:2014-03-03 06:15:23
【问题描述】:
我需要帮助在 Windows 下设置 PyGObject。我有installed it,但从gi.repository 导入Gtk 和Gdk 时出现以下错误
ERROR:root:Could not find any typelib for Gtk
Traceback (most recent call last):
File "example.py", line 2, in <module>
from gi.repository import Gtk
ImportError: cannot import name Gtk
我可以导入 gi.repository.GLib、gi.repository.Gio、gi.repository.GObject、gi.repository.cairo 和 cairo,但我无法导入 gi.repository.Gtk 和 gi.repository.Gdk 和 gi.repository.GdkPixbuf。
我已经尝试从添加/删除程序中的卸载程序卸载它,然后重新安装它,但错误仍然存在。
如果有人可以提供帮助,我们将不胜感激。
【问题讨论】:
-
你用的是什么版本的windows?
-
@Sam Windows 7,32 位。
-
这可能也与为什么我的操作系统(Ubuntu 14.04 64 位)上的 Ubuntu 软件中心也损坏有关。我有完全相同的错误(只是从模块中添加了一个它没有处理的导入)。
标签: python python-3.x gtk3 pygobject