模块未找到 - PYTHON

时间:2016-03-27 16:06:35

标签: python

当我使用此命令时

import sys
sys.path

返回

['', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\python35.zip', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\DLLs', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\lib', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\win32', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\win32\\lib', 'C:\\Users\\Keshav Reddy\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\Pythonwin']

当我使用pip安装pywinauto时,

C:\Users\Keshav Reddy\pip install pywinauto

它返回,

C:\Users\Keshav Reddy\pip install pyautogui

它返回,

Requirement already satisfied (use --upgrade to upgrade): pyautogui in c:\users\keshav reddy\appdata\local\programs\python\python35-32
Requirement already satisfied (use --upgrade to upgrade): pymsgbox in c:\users\keshav reddy\appdata\local\programs\python\python35-32\lib\site-packages (from pyautogui)
Requirement already satisfied (use --upgrade to upgrade): PyTweening>=1.0.1 in c:\users\keshav reddy\appdata\local\programs\python\python35-32\lib\site-packages (from pyautogui)
Requirement already satisfied (use --upgrade to upgrade): Pillow in c:\users\keshav reddy\appdata\local\programs\python\python35-32\lib\site-packages (from pyautogui)
Requirement already satisfied (use --upgrade to upgrade): pyscreeze in c:\users\keshav reddy\appdata\local\programs\python\python35-32\lib\site-packages (from pyautogui)

但是当我导入它时,

C:\Users\Keshav Reddy\python

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyautogui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pyautogui'

不确定问题出在哪里。

1 个答案:

答案 0 :(得分:-1)

我建议您尝试在终端中键入以下内容:

pip freeze

并查看在该模块列表中是否有您正在寻找的模块。如果您没有看到该模块,请尝试输入

sudo pip install XYZ

其中xyz是您有兴趣安装的模块。