Windows系统(pip Nomodule报错)
Traceback (most recent call last):
File "d:\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\PYthon\Scripts\pip3.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'
解决办法
- 打开CMD,执行命令获取python的安装路径(你自己知道的话可省略该步)
C:\Users\Administrator>where python
D:\PYthon\python.exe
- (以我的路径为例)执行下两个命令,不出意外出现很长一段
C:\Users\Administrator>cd /d D:/PYthon/Scripts
D:\PYthon\Scripts>easy_install.exe pip
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/54/eb/4a3642e971f404d69d4f6fa3885559d67562801b99d7592487f1ecc4e017/pip-20.3.3-py2.py3-none-any.whl#sha256=fab098c8a1758295dd9f57413c199f23571e8fde6cc39c22c78c961b4ac6286d
Best match: pip 20.3.3
Processing pip-20.3.3-py2.py3-none-any.whl
Installing pip-20.3.3-py2.py3-none-any.whl to d:\python\lib\site-packages
Adding pip 20.3.3 to easy-install.pth file
Installing pip-script.py script to d:\python\Scripts
Installing pip.exe script to d:\python\Scripts
Installing pip3-script.py script to d:\python\Scripts
Installing pip3.exe script to d:\python\Scripts
Installing pip3.8-script.py script to d:\python\Scripts
Installing pip3.8.exe script to d:\python\Scripts
Installed d:\python\lib\site-packages\pip-20.3.3-py3.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
- 打完收工,查看pip版本
pip -V
pip 20.3.3 from d:\python\lib\site-packages\pip-20.3.3-py3.7.egg\pip (python 3.7)