python - 安装pbr时出错

标签 python macos openstack python-pbr

我想在运行 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

我该如何解决这个问题?

请帮忙。 谢谢你

最佳答案

这是因为来自 git repo 的构建正在开发中,可能存在错误。我使用 pip 从稳定版本(在 pypi 上)安装 pbr,如下所示:

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

如果您有easy_installpip 然后按照this教程。

如果您不想使用像 easy_installpip 这样的包管理器。然后你可以前往 the PyPI page ,并下载 tarball。只需提取 tarball 并在 pbr 包中运行 python setup.py。但是安装 pip 会在以后为您省去很多麻烦。

关于python - 安装pbr时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19087562/

相关文章:

bash - 如何让 GNU screen 识别 UTF-8 字符

kubernetes - helm purge 后某些 PVC 未被删除

python - 使用 pandas.read_csv 索引 DataFrame pandas

python - python 中 rnorm 的模拟

ios - 在真实设备上运行应用程序时 Xcode : No code signature found,

java - 在 Eclipse Indigo 中缓慢打开 "Dynamic web project"折叠

python - 使用 OpenCV 4.5.1 打开 VideoStream 可在 Windows 上运行,但在 Docker python :3. 9.2-slim-buster 上针对特定 IP cam 失败

python - Left Outer 通过数据框上的键、系列上的索引将数据框与 Series 对象连接起来

python 和 PEP 440 - 这个关于 PEP440 的警告有多严重?

kubernetes - 在 OpenStack 上部署 Kubernetes