gpt4 book ai didi

python - 版本冲突: (pip 9. 0.2(/usr/local/lib/python3.5/site-packages),Requirement.parse ('pip==9.0.1')

转载 作者:行者123 更新时间:2023-12-01 09:33:29 27 4
gpt4 key购买 nike

我使用 docker Commit docker-compose builddocker-compose up -d

yum install python-35 -y 并安装软件包,我在 docker-compose.yml 中添加 pip-3.5 install --upgrade pip 它引发了 VersionConflict 错误

You are using pip version 9.0.2, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ pip-3.5 install awscli
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 666, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.2 (/usr/local/lib/python3.5/site-packages), Requirement.parse('pip==9.0.1'))

During handling of the above exception, another exception occurred:

但我不知道为什么它需要 pip==9.0.1 对我来说......

如何使用 pip>=9.0.2 解决问题?

添加

我的设置.py

install_requires = [
'nitro>=1.3.0,<1.4.0',
'mysqlclient',
'requests',
'beautifulsoup4',
'google-api-python-client',
'httplib2',
'raven',
]

当我检查aws-cli/setup.py时在github上

aws-cli/requirement.txt

没有pip=9.0.1

当我更改pip-3.5安装awscli -> pip-3.5安装ipython

有同样的错误

+ pip-3.5 install ipython
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 666, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.3 (/usr/local/lib/python3.5/site-packages), Requirement.parse('pip==9.0.1'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/pip-3.5", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3144, in <module>
@_call_aside
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3128, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3157, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 668, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 681, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 870, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application

最佳答案

通过 python 调用 pip 对我来说很有效,例如:

python3 -m pip install --upgrade pip==9.0.1

(或者您在 Requirement.parse('pip==X.Y.Z') 中看到的任何版本)

关于python - 版本冲突: (pip 9. 0.2(/usr/local/lib/python3.5/site-packages),Requirement.parse ('pip==9.0.1'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49748870/

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