在 Windows 10 上为 python 3.6.1 安装 pygtk [英] install pygtk for python 3.6.1 on Windows 10
问题描述
由于 PIL.ImageGrab()
给了我一些问题,我进一步阅读了该主题,似乎 gtk
是制作屏幕截图的更好解决方案.但我不明白哪些包实际有效,哪些已弃用.尝试
Since PIL.ImageGrab()
gave me some problems, I read further into the topic and it seems that gtk
is the better solution for making Screenshots.
But I don't understand which packages are actually working and which are deprecated.
trying
pip install pygtk
给我
ERROR: Could not import dsextras module: Make sure you have installed pygobject.
pygobject
不存在,安装 gobject
没有帮助.
pygobject
doesn't exist, installing gobject
doesn't help.
我尝试了模块名称的一些变体,例如 python3-
或在最后只是 3
,但我似乎没有找到正确的.
I tried some variants of the module name like python3-
or just 3
at the end, but I don't seem to get the right one.
推荐答案
关于此的完整聊天会话在这里.可以在此处阅读原始解决方案,尤其是@cdarke 的评论.
The full chat session about this is here. The original solution can be read here, especially the comment made by @cdarke.
无论如何,解决方案是使用 Python3.5 intead 3.6 或更高版本,至少在 MSYS2 更新之前.
So anyway, the solution is to use Python3.5 intead of 3.6 or newer, at least until MSYS2 is updated.
作为旁注,您真的不想使用 pygtk(基于 Gtk2).像这样使用 pygobject:
As a sidenote, you really don't want to use pygtk (which is based on Gtk2). Use pygobject like such:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
这篇关于在 Windows 10 上为 python 3.6.1 安装 pygtk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!