Pyautogui Screenshot Functions return AttributeError 'module' object has no attribute

北城余情 提交于 2021-02-10 05:44:05

问题


I have installed Python 3.4 and Pillow. All the other functions are working related to pyautogui only the screenshots and other image recognition things are not working.

>>> import pyautogui
>>> pyautogui.locateOnScreen('chrome.PNG')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'locateOnScreen'

same results show to screen capture function also.

In windows 7 OS

I have read the below link but non of the results worked for me Python: 'pyautogui' has no attribute 'screenshot' (Windows)


回答1:


Try Downloading the exact version by mentioning it it in pip.

pip install PyAutoGUI-0.9.35

or

pip install pyautogui==0.9.35

That worked for me.




回答2:


If having problem with pillow module, first install pillow model through easy installation in command line

easy_install Pillow

then install the PyAutoGui via

pip install PyAutoGUI-0.9.35

All in Command Line as Administrator.



来源:https://stackoverflow.com/questions/44175395/pyautogui-screenshot-functions-return-attributeerror-module-object-has-no-attr

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