1

我正在尝试安装 devstack(stable/newton)。我收到以下错误:

Traceback (most recent call last):
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
2016-11-29 16:36:55.348 |     status = self.run(options, args)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
2016-11-29 16:36:55.348 |     wb.build(autobuilding=True)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
2016-11-29 16:36:55.348 |     self.requirement_set.prepare_files(self.finder)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
2016-11-29 16:36:55.348 |     ignore_dependencies=self.ignore_dependencies))
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 521, in _prepare_file
2016-11-29 16:36:55.348 |     req_to_install.check_if_exists()
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1036, in check_if_exists
2016-11-29 16:36:55.348 |     self.req.name
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 558, in get_distribution
2016-11-29 16:36:55.348 |     dist = get_provider(dist)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 432, in get_provider
2016-11-29 16:36:55.348 |     return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 968, in require
2016-11-29 16:36:55.348 |     needed = self.resolve(parse_requirements(requirements))
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 859, in resolve
2016-11-29 16:36:55.348 |     raise VersionConflict(dist, req).with_context(dependent_req)
2016-11-29 16:36:55.348 | ContextualVersionConflict: (oslo.policy 1.14.0 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('oslo.policy>=1.15.0'), set(['neutron-lib']))

我尝试使用 pip 升级 oslo.policy,但问题仍然存在。有关如何解决此问题的任何指示?

4

1 回答 1

1

这是由全球需求变化引起的。有些项目会比其他项目更快地合并需求。如果您还没有这样做,请从 master 获取最新的克隆。然后,您可以 grep 查找“oslo.policy>”并查看哪个项目的需求文件正在降低版本。

要查看版本号,请在 /opt/stack/ 目录中运行以下命令:

    grep -r "oslo.policy>"

注意:在此之后,解决方案将仅在提出问题时起作用。以下可以作为一个示例,说明如何制作自己的 grep 和 sed 命令来进行更新。目标是使您的所有需求文件都具有相同的 oslo.policy 版本。

我看到 1.14.0 版本让你失望了,所以你想做的是:

    grep -r -l "oslo.policy>=1.14.0" | xargs -l sed -i -e "s/oslo.policy>=1.14.0/oslo.policy>=1.15.0/g"

这将为您进行查找和替换。之后,您应该通过再次运行第一个 grep 来验证文件确实已更改。您可能需要更改模式以匹配版本,有时是 1.14.0,有时可能只是 1.14

最后,升级 oslo.policy 并重试。

于 2016-12-10T20:35:09.827 回答