gpt4 book ai didi

python - 导入错误: cannot import name GdkX11

转载 作者:行者123 更新时间:2023-12-01 05:16:30 24 4
gpt4 key购买 nike

我是一名 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。

最佳答案

GdkX11 是一个依赖于平台的库,仅在 X11 平台上可用(顾名思义)。您在 Windows 上找不到它,必须使用替代品。

关于python - 导入错误: cannot import name GdkX11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23088531/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com