Skip to main content
 首页 » 编程设计

python之找不到模块之PYTHON

2025年05月04日10tintown

当我使用这个命令时

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' 

不确定问题出在哪里。

请您参考如下方法:

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

pip freeze 

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

sudo pip install XYZ 

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