赞
踩
python -m ensurepip
C:\WINDOWS\system32>python -m ensurepip
Looking in links: C:\Users\Dell\AppData\Local\Temp\tmp3zn14kmm
Requirement already satisfied: setuptools in d:\program files(x86)\python37\lib\site-packages (39.0.1)
Collecting pip
Installing collected packages: pip
Successfully installed pip-10.0.1
经过上述操作后,会出现以下错误:
C:\WINDOWS\system32>pip install --upgrade pip
Traceback (most recent call last):
File "d:\program files(x86)\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\program files(x86)\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Program Files(x86)\Python37\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip._internal.cli'
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --force-reinstall
C:\WINDOWS\system32>curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1840k 100 1840k 0 0 920k 0 0:00:02 0:00:02 --:--:-- 736k
C:\WINDOWS\system32>python get-pip.py --force-reinstall
Collecting pip
Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-20.2.2
pip show pip
C:\WINDOWS\system32>pip show pip
Name: pip
Version: 20.2.2
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Location: d:\program files(x86)\python37\lib\site-packages
Requires:
Required-by:
参考资料:
【1】使用pip安装模块时提示: No module named pip
【2】pip升级时报错— No module named ‘pip._internal’
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。