gpt4 book ai didi

pip - 升级后pip无法正常工作

转载 作者:行者123 更新时间:2023-12-03 12:31:50 25 4
gpt4 key购买 nike

我尝试使用以下命令升级pip3:

sudo pip3 install --upgrade pip



但不幸的是,它不再起作用并显示以下消息:

pip3 --version



信息:

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 651, in _build_master ws.require(requires)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 952, in require needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 844, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.VersionConflict: (pip 7.1.2 (/usr/local/lib/python3.4/dist-packages), Requirement.parse('pip==1.5.6'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in from pkg_resources import load_entry_point
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3084, in @_call_aside
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3070, in _call_aside f(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 3097, in _initialize_master_working_set working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 653, in _build_master return cls._build_from_requirements(requires)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 666, in _build_from_requirements dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py", line 839, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==1.5.6' distribution was not found and is required by the application



如何解决?

最佳答案

似乎您没有使用virtualenv,并且您的python /路径可能被弄乱了。
我在Ubuntu 14.04上遇到了python-2.7和-3.4的类似问题。我试过了

sudo python -m pip install --upgrade --force-reinstall pip

为2.7,它有所帮助。然后我通过 pip为python-3.4重新安装了 easy_install3

关于pip - 升级后pip无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32565303/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com