Install pygtk for python 3.6.1 on Windows 10

Since it PIL.ImageGrab()

gave me some trouble, I read further in the thread and it seems that gtk

is the best solution for taking screenshots. But I don't understand which packages actually work and which are deprecated. trying

pip install pygtk

      

gives me

ERROR: Could not import dsextras module: Make sure you have installed pygobject.

      

pygobject

does not exist, installation gobject

does not help.

I tried several options for the module name, for example python3-

, or just 3

at the end, but I seem to be wrong.

+3


source to share


2 answers


for GTK +, you should do the following:

from gi.repository import Gtk

      



and not:

import gtk

      

0


source


Full chat session about this here . The original solution can be read here , especially the comment made by @cdarke.

Either way, the solution is to use Python3.5 instead of 3.6 or newer, at least until the MSYS2 update.



As a side note, you really don't want to use pygtk (which is based on Gtk2). Use pygobject for example:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

      

0


source







All Articles