【发布时间】:2018-01-22 22:06:54
【问题描述】:
我正在尝试使用pyautogui 模块截屏,但一直收到此错误
>>> image = pyautogui.screenshot()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pyautogui' has no attribute 'screenshot'
我有什么遗漏吗? Automate the Boring Stuff with Python 中的章节说,当我在 Windows 上时,除了 pyautogui 本身之外,我不需要下载任何东西来工作。有谁知道为什么会发生这种情况?提前致谢。
编辑:我正在使用 Anaconda,所以我已经有 Pillow。
【问题讨论】:
-
尝试使用 sudo pip install -U pyautogui 更新 pyautogui
-
根据the documentation,你也需要枕头。
-
忽略了:我正在使用 Anaconda,所以已经有了 Pillow。现在将编辑问题以包含该问题。另外,我的 pyautogui 是最新的。
-
你在某处还有其他名为“pyautogui.py”的脚本吗?喜欢在当前目录中?
-
@kindall 不,我不这么认为。可能有一个隐藏在某个地方,但我没有创建一个,所以我看不出有任何理由应该存在一个。为什么?
标签: python windows screenshot pyautogui