[英]PIP --upgrade not working on Python 3.8.2
I do have Python version 3.8.2 and an outdated version of PIP.我确实有 Python 版本 3.8.2 和 PIP 的过时版本。 I am using a Mac, and when I try to upgrade PIP by doing pip install --upgrade pip
I'm getting this error message:我使用的是 Mac,当我尝试通过执行pip install --upgrade pip
来升级 PIP 时,我收到以下错误消息:
➜ ~ pip install --upgrade pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
@_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==18.0' distribution was not found and is required by the application
➜ ~ ```
You will have to reinstall pip manually by following the steps here described.您必须按照此处描述的步骤手动重新安装 pip。
python get-pip.py
in the folder you downloaded the python script to.在将 python 脚本下载到的文件夹中运行python get-pip.py
。 pip
runs the 2.7 pip. pip
运行 2.7 pip。 Look at the traceback.看回溯。 pip3
runs a 3.x pip, and if 3.8 is the only one, 3.8. pip3
运行 3.x pip,如果只有 3.8,则为 3.8。 python3 -m pip
will run some 3.x pip and python3.8 -m pip
will only run 3.8 pip. python3 -m pip
will run some 3.x pip and python3.8 -m pip
will only run 3.8 pip. I recommend that you first upgrade to 3.8.7.我建议你先升级到 3.8.7。 I forget whether the python.org installer has an option to upgrade pip with it.我忘记了 python.org 安装程序是否可以选择升级 pip。 If not,如果不,
python3.8 -m pip install --upgrade pip
should work (I just ran it).应该工作(我刚刚运行它)。 If not如果不
python3.8 -m ensurepip
should install a recent pip which can be upgraded.应该安装一个可以升级的最近的 pip。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.