Error when installing pbr

こ雲淡風輕ζ 提交于 2019-12-10 13:12:04

问题


I want to install openstack client on my machine running OSX 10.8.5. As a prerequisite, i need to install pbr. So, i did the following

git clone git://github.com/openstack-dev/pbr.git
cd pbr
sudo python setup.py install

But im getting the following error trace

Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    **util.cfg_to_args())
  File "/Users/jimcgh/dev/pbr/pbr/util.py", line 241, in cfg_to_args
    pbr.hooks.setup_hook(config)
  File "/Users/jimcgh/dev/pbr/pbr/hooks/__init__.py", line 27, in setup_hook
    metadata_config.run()
  File "/Users/jimcgh/dev/pbr/pbr/hooks/base.py", line 29, in run
    self.hook()
  File "/Users/jimcgh/dev/pbr/pbr/hooks/metadata.py", line 28, in hook
    self.config['name'], self.config.get('version', None))
  File "/Users/jimcgh/dev/pbr/pbr/packaging.py", line 817, in get_version
    version = _get_version_from_git(pre_version)
  File "/Users/jimcgh/dev/pbr/pbr/packaging.py", line 776, in _get_version_from_git
    "git --git-dir=\"" + git_dir + "\" describe --always").replace(
  File "/Users/jimcgh/dev/pbr/pbr/packaging.py", line 220, in _run_shell_command
    stderr=err_location)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
    raise child_exception
TypeError: must be encoded string without NULL bytes, not str

How can i fix this ?

Please help. Thank You


回答1:


This is because the build from the git repo is in development, and might have bugs. I used pip to install pbr from the stable release version (on pypi) like this:

sudo easy_install pip # if you don't already have pip
pip install pbr

If you have easy_install or pip then follow this tutorial.

If you don't want to use a package manager like easy_install or pip. Then you can head over to the PyPI page, and download the tarball. Simply extract the tarball and run python setup.py within the pbr package. But install pip will save you a lot of hassle in the future.



来源:https://stackoverflow.com/questions/19087562/error-when-installing-pbr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!