Python Forum

Full Version: Does python 3.7.2 work w/ PIL 5.4.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My question was explained in the title but I'll go a bit more in depth. So i downloaded pillow via the cmd using pip by typing "pip install Pillow". But my python 3.7.2 still doesn't seem to know what "ImageGrab" is. So I'm wondering if even the newest version of PIL works for an older python rather than the newer one and if so, can someone tell me which python? I would appreciate any info. Thanks in Advance.
Quote:Does python 3.7.2 work w/ PIL 5.4.1
PIL stands for Python Imaging Library, so answer is of course yes.
Quote:still doesn't seem to know what "ImageGrab"
ImageGrab is available for windows and Mac, but not Linux
to use it, import as:
till doesn't seem to know what "ImageGrab"
from PIL import ImageGrab
which will of course give you an error on Linux
You can use this for example: https://github.com/ponty/pyscreenshot

pyscreenshot.grab(backend='pyqt5')
Output:
<PIL.PngImagePlugin.PngImageFile image mode=RGB size=1920x1080 at 0x7F54AB131198>
If you don't want to inject an additional dependency, you can look in the code how to use one of the backends (qt, gtk, etc..).