安装pbr时出现错误

6

我想在运行OSX 10.8.5的计算机上安装Openstack客户端。作为前提条件,我需要安装pbr。因此,我进行了以下操作:

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

但我得到了以下错误跟踪

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

如何解决这个问题?

请帮忙。 谢谢您

1个回答

3

这是因为git仓库中的构建处于开发中,可能有bug。我使用pip从稳定发布版本(在pypi上)安装了pbr,方法如下:

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

如果您有easy_installpip,请按照此教程操作。
如果您不想使用像easy_installpip这样的软件包管理器。 那么您可以前往PyPI页面,并下载tarball文件。只需提取tarball文件并在pbr包内运行python setup.py即可。但安装pip将为您节省很多麻烦。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接