python - AttributeError:模块 'pyautogui' 没有属性 'size'
问题描述
作为Python的初学者,我真的不知道我在这里做错了什么?
我想与pyautogui
:
>>> import pyautogui
>>> pyautogui.PAUSE = 1
>>> pyautogui.FAILSAFE = True
>>> pyautogui.size()
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
pyautogui.size()
AttributeError: module 'pyautogui' has no attribute 'size'
不知道为什么它不显示我的分辨率?通常,pyautogui 不适用于以下命令:
>>> pyautogui.moveTo(100, 100, duration=0.25)
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
pyautogui.moveTo(100, 100, duration=0.25)
AttributeError: module 'pyautogui' has no attribute 'moveTo'
>>>
我确定我安装了 pip。
解决方案
Your own script which is named "pyautogui.py" is interfering with the module you installed — so rename it something else.
推荐阅读
- android - 为什么我的图片没有显示在 recyclerview 中?
- javascript - 如何使用 node.js 的 fs.existsSync 函数检查 nuxt.js 中的文件是否存在?
- sql - 添加当月累积的行
- python - 使用 pytesseract OSD 时,找不到文件错误,但文件名看似随机
- jsf - JSF 使用 ui:repeat varStatus.index 作为数组索引
- html - 如何在字符后移动按钮:
- apache-flink - 无法在 Flink 集群上运行 PubSubSource
- android - “端口 53:地址已在使用中”当我运行 docker compose up 命令时出现 docker 错误
- python - Python selenium 提交表单的结果
- java - MyBatis LocalDateTimeTypeHandler 实现依赖于厂商转换