ubuntu上安装了多个gunicorn出现版本冲突,不知如何解决
问题描述
ubuntu上安装了多个gunicorn出现版本冲突,自己之前pip3 install gunicorn过,又easy install过。。。就是乱装打,现在出现VersionConflict不知道如何处理。
问题出现的平台版本及自己尝试过哪些方法
remove和easy install -m过
你期待的结果是什么?实际看到的错误信息又是什么?
在终端输入gonicorn报错如下:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 943, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 834, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (gunicorn 19.9.0 (/home/rex/下载/gunicorn), Requirement.parse('gunicorn==19.4.5'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/gunicorn", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
@_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'gunicorn==19.4.5' distribution was not found and is required by the application
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pkg_resources.VersionConflict: (gunicorn 19.9.0 (/home/rex/下载/gunicorn), Requirement.parse('gunicorn==19.4.5'))
pkg_resources.DistributionNotFound: The 'gunicorn==19.4.5' distribution was not found and is required by the application
你的错误信息里的这2句比较关键,意思是说你现在找到的是gunicorn19.9.0,而你在项目里声明使用的是19.4.5版本的。所以最容易的解决方案是想办法修改项目里使用的版本号为19.9.0即可