Python:'pyautogui' 没有属性 'screenshot' (Windows) [英] Python: 'pyautogui' has no attribute 'screenshot' (Windows)
问题描述
我正在尝试使用 pyautogui
模块截取屏幕截图,但不断收到此错误
有什么我遗漏的吗?使用 Python 自动化无聊的东西 中的一章说,因为我在 Windows 上,所以我不需要下载除 pyautogui
本身以外的任何东西,以使其正常工作.有谁知道为什么会发生这种情况?提前致谢.
我正在使用 Anaconda,所以我已经有了 Pillow
.
from pyautogui import screenshotUtilim=screenshotUtil.screenshot()打印 im.getpixel((850, 850))
我试过了.它似乎与文档不同.希望这是有帮助的.
I am trying to take a screenshot with the pyautogui
module, but keep getting this error
>>> image = pyautogui.screenshot()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pyautogui' has no attribute 'screenshot'
Is there something I'm missing? The chapter in Automate the Boring Stuff with Python said that as I'm on Windows, I shouldn't need to download anything other than pyautogui
itself for this to work. Anyone know why this might happen? Thanks in advance.
EDIT: I am using Anaconda so I already have Pillow
.
from pyautogui import screenshotUtil
im=screenshotUtil.screenshot()
print im.getpixel((850, 850))
I have tried. It's seem to different from the document. to hope this is helpful.
这篇关于Python:'pyautogui' 没有属性 'screenshot' (Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!