安装PBR时发生错误 [英] Error when installing pbr

查看:180
本文介绍了安装PBR时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行OSX 10.8.5的计算机上安装openstack客户端.作为前提条件,我需要安装pbr.所以,我做了以下

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

我该如何解决?

请帮助. 谢谢

推荐答案

这是因为git repo的构建正在开发中,并且可能存在错误.我使用pip从这样的稳定​​发行版(在pypi上)安装pbr:

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

如果您拥有easy_installpip,请按照教程进行操作.

If you have easy_install or pip then follow this tutorial.

如果您不想使用像easy_installpip这样的程序包管理器.然后,您可以转到 PyPI页面,然后下载压缩包.只需解压缩tarball并在pbr包中运行python setup.py.但是安装pip将来会为您节省很多麻烦.

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.

这篇关于安装PBR时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆