python - Pyautogui 屏幕截图函数返回 AttributeError 'module' 对象没有属性

标签 python python-imaging-library pyautogui

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

相关文章:

python - Apache mod_wsgi : PermissionError when trying to access a page

python linux - 以文件名显示图像作为查看器窗口标题

python - 如何使用 PIL 将 1 channel 图像转换为 3 channel 图像?

python - 文档说要使用置信度参数,但会引发错误

python - 收到 TypeError : Required argument 'object' (pos 1) not found

python - 针对一个字符串测试多个子字符串

python - 根记录器忽略记录器级别

python - 使用 PIL 将以不同像素保存的复制图像复制到原始图像

python - 如何使用 PIL 从 100 张图片中获取平均图片?

user-interface - 在移动设备上使用 PyAutoGUI 之类的方法?