1

I am trying to install devstack(stable/newton). I am getting the following error:

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']))

I tried upgrading oslo.policy using pip but the issue still persists. Any pointers on how to resolve this?

Pradeep
  • 1,198
  • 3
  • 12
  • 22
  • Did you try installing the required version (>=1.15.0)? If the above didn't work, then delete the python packages using **rm -rf /usr/local/lib/python2.7/dist-packages/*** – dpaks Nov 30 '16 at 11:29

1 Answers1

1

This is caused by a global requirements change. Some projects will merge the requirements faster than others. If you haven't done so already, get the latest clone from master. Then you can grep for "oslo.policy>" and see which project's requirements file is bringing the version down.

To see the version number run this command in the /opt/stack/ directory:

    grep -r "oslo.policy>"

NOTE: After this point the solution will only work at the time the question was asked. The following can be considered as an example on how to make your own grep and sed command to make the updates. The goal is to make all your requirements files have the same oslo.policy version.

I see version 1.14.0 is bringing you down so what you want to do is:

    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"

This will do a find and replace for you. After that you should verify the files were indeed changed by running the first grep again. You may have to change the pattern to match the version, sometimes it is 1.14.0 and other times it can be just 1.14

Finally, upgrade oslo.policy and try again.

  • Worked like a charm. It was not only oslo.policy, there were many packages with version mismatch. Used the above command to resolve them. – Pradeep Jan 04 '17 at 06:28
  • hi, i'm having the same problem i used these commands but when i try to `stack.sh` again it sets them back to the older versions. Any thoughts about that ? – Mheni Jul 03 '18 at 20:00
  • @Mheni So first of all I would try to get the latest versions of the repositories, there's a chance they updated their requirements files by now and this problem is fixed. If you're working off master there's a small window where this will happen. The 2nd command will not work anymore, it needs to be updated. If you investigate the oslo.policy version given by running the 1st command, try to change the requirements to the latest version in the output of the grep. You can modify the 2nd command to fit your needs or just edit the files yourself. – Trevor McCasland Jul 04 '18 at 14:23