Python 3- pyautogui can't use screen shot functions

六眼飞鱼酱① 提交于 2019-12-23 01:04:18

问题


Python 3.6.4

Pillow (PIL) 5.0

OS Win 7

pyscreeze 0.1.13

I'm trying to utilize the screenshot functions with pyautogui, but encountering an issue.

import pyautogui
image = pyautogui.locateOnScreen('imagepath')
print(image)

I'm receiving the following error:

File "C:\Users\a7153\AppData\Local\Programs\Python\Python36\lib\site-packages\pyscreeze__init__.py", line 315, in _screenshot_win32 im = ImageGrab.grab() NameError: name 'ImageGrab' is not defined

I've tried going to pyscreeze and directly importing from PIL (pillow) import ImageGrab, but with no luck. I've gone through the documentation and there doesn't seem to be anything on the issue. Does anyone have any suggestions?

来源:https://stackoverflow.com/questions/48208631/python-3-pyautogui-cant-use-screen-shot-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!