问题
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