Python pyautogui 导入错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31635140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
import error for pyautogui
提问by Nixxon
I installed the pyautogui module and dependencies via pip-3.2 on my raspi correctly, However when I am trying to do
我通过 pip-3.2 在我的 raspi 上正确安装了 pyautogui 模块和依赖项,但是当我尝试这样做时
import pyautogui
I am getting an import error:
我收到导入错误:
ImportError: No module named pyautogui
What am I doing wrong? Did the command change? Sorry I am a total python Noob, any help is greatly appreciated :D
我究竟做错了什么?命令有变化吗?对不起,我是一个完整的 python 菜鸟,非常感谢任何帮助:D
采纳答案by Sentient07
It might be because you're trying it from a python 2.x shell. Instead try this command on a python3 shell and try importing the same.
这可能是因为您正在从 python 2.x shell 中尝试它。而是在 python3 shell 上尝试此命令并尝试导入相同的命令。
回答by abass
True you would have to use python 3. First you have to make sure you checked the change system path variable while installing python 3. then open the command prompt on windows and type
是的,您必须使用 python 3。首先,您必须确保在安装 python 3 时检查了更改系统路径变量。然后在 Windows 上打开命令提示符并键入
pip install pyautogui
or
或者
pip3 install pyautogui
in osx and linux.
在 osx 和 linux 中。
回答by Arpitt Desai
Search in C:\Python37-32\Lib\site-packages (Where-ever you have installed it). Check if you have pyautoguidirectory.
在 C:\Python37-32\Lib\site-packages 中搜索(无论你在哪里安装它)。检查您是否有pyautogui目录。
If YESthen there exists a configuration issue with pycharmor IDLE.
如果是,则pycharm或IDLE存在配置问题。
If NOthen
如果没有那么
- Open Command Prompt
- cd
C:\Python37-32\Scripts
pip install pillow
pip install pyautogui
- 打开命令提示符
- 光盘
C:\Python37-32\Scripts
pip install pillow
pip install pyautogui
Check for Successfully installedresponse.
检查成功安装的响应。
HAPPY CODING! :)
快乐编码!:)