我已经安装了Python 3.4和Pillow。所有其他功能都与 pyautogui 相关,只有屏幕截图和其他图像识别功能不起作用。
>>> import pyautogui
>>> pyautogui.locateOnScreen('chrome.PNG')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'locateOnScreen'
屏幕捕获功能也显示相同的结果。
在 Windows 7 操作系统中
我已阅读以下链接,但没有一个结果对我有用 Python: 'pyautogui' has no attribute 'screenshot' (Windows)
最佳答案
尝试通过在 pip 中提及来下载确切的版本。
pip install PyAutoGUI-0.9.35
或
pip install pyautogui==0.9.35
这对我有用。
关于python - Pyautogui 屏幕截图函数返回 AttributeError 'module' 对象没有属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44175395/