Pyautogui 截图函数返回 AttributeError 'module' 对象没有属性 [英] Pyautogui Screenshot Functions return AttributeError 'module' object has no attribute

查看:123
本文介绍了Pyautogui 截图函数返回 AttributeError 'module' 对象没有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Python 3.4 和 Pillow.所有其他功能都在与 pyautogui 相关,只有屏幕截图和其他图像识别功能不起作用.

<预><代码>>>>导入pyautogui>>>pyautogui.locateOnScreen('chrome.PNG')回溯(最近一次调用最后一次):文件<stdin>",第 1 行,在 <module> 中AttributeError: 'module' 对象没有属性 'locateOnScreen'

同样的结果也显示给屏幕截图功能.

在 Windows 7 操作系统中

我已阅读以下链接,但没有任何结果对我有用Python:'pyautogui' 没有属性 'screenshot' (Windows)

解决方案

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

pip install PyAutoGUI-0.9.35

pip install pyautogui==0.9.35

这对我有用.

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)

解决方案

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.

这篇关于Pyautogui 截图函数返回 AttributeError 'module' 对象没有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆