Pyautogui Screenshot Functions return AttributeError 'module' 对象没有属性

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

我已经安装了 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 OS

我已阅读以下内容 link 但没有一个结果对我有用 Python: 'pyautogui' has no attribute 'screenshot' (Windows)

通过在 pip 中提及它来尝试下载确切的版本。

pip install PyAutoGUI-0.9.35

pip install pyautogui==0.9.35

这对我有用。

如果 pillow 模块有问题,请先在命令行中通过简单安装来安装 pillow 模型

easy_install Pillow

然后通过

安装 PyAutoGui
pip install PyAutoGUI-0.9.35

全部以管理员身份在命令行中。

我有同样的问题,通过卸载 pyscreeze 和 pyautogui 并重新安装确切的版本来解决

1.) pip uninstall pyscreeze pyautogui

2.) pip install pyautogui==0.9.35