1

我在 Windows 7 上使用 Python 2.7。我使用 pycharm 和 IDLE。我正在尝试 pyautogui 进行一些自动鼠标移动,但程序返回未定义的 puautogui。我在网上读到 pyautogui 在 windows 中不需要任何额外的包。

我在 IDLE 中输入了 import pyautogui,结果出现了错误。你能帮忙吗?

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit          (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import pyautogui

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyautogui
ImportError: No module named pyautogui
>>> 
4

2 回答 2

2

要安装 PyAutoGUI,请从 PyPI 和依赖项中安装 pyautogui 包。

在 Windows for Python 2.7 上,这是:

C:\Python27\python.exe -m pip install pyautogui
于 2015-07-26T12:58:02.243 回答
-1

据说解释器找不到 pyautogui ......你确定你安装了它吗......

如果没有.....首先键入 pip uninstall PyautoGUI 然后请在 CMD 或 Powershell 中键入 pip install PyautoGUI

欲了解更多信息,请访问: https ://pypi.org/project/PyAutoGUI/

于 2021-06-26T08:44:42.620 回答