2013-09-30 254 views
5

我想在運行OSX 10.8.5的機器上安裝openstack客戶端。作爲先決條件,我需要安裝pbr。所以,我做了以下安裝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 

我怎樣才能解決這個問題?

請幫忙。 謝謝

回答

3

這是因爲從git回購的構建是在開發中,並可能有錯誤。我以前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。簡單地提取壓縮包並在pbr包中運行python setup.py。但安裝pip將爲您節省很多麻煩。