我是Windows开发人员并尝试启动PyGTK开发。我想从GTK + 3开始,然后开始documentation。
我的环境:
我的代码:
from gi.repository import Gtk
from gi.repository import GdkX11
错误:
ERROR:root:Could not find any typelib for GdkX11
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 1534, in <module>
debugger.run(setup['file'], None, None)
File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\pydevd.py", line 1145, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm 3.1\helpers\pydev\_pydev_execfile.py", line 37, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc) #execute the script
File "Z:/git.repositories/gourmet-frontend/python/gourmet/main_gtk3.py", line 27, in <module>
from gi.repository import GdkX11
ImportError: cannot import name GdkX11
当我安装pygi-aio-3.10.2-win32_rev18-setup.exe时,我选择所有选项并检查降级为GTK + 3.8.9。
答案 0 :(得分:2)
GdkX11
是一个依赖于平台的库,仅在X11平台上可用(顾名思义)。你不会在Windows上找到它,你将不得不使用替代品。