ModuleNotFoundError: No module named 'pip'

臭大佬 2020-05-12 23:40:54 1454
Python 
简介 ModuleNotFoundError: No module named 'pip'

问题

今天在安装python包的时候,发现如下报错信息:

Traceback (most recent call last):
  File "xxx", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "xxx\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "xxx\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

解决

运行如下两行命令

python -m ensurepip

 python -m pip install --upgrade pip

测试安装包: