我正在尝试在Mac(10.4.8)上安装openstack nova客户端

nova = https://github.com/openstack/python-novaclient#command-line-api

python --version
Python 2.7.2


我成功安装了nova(after installing pip

运行客户端时,出现以下错误

foo@bar-macbook-pro:~$ nova
Traceback (most recent call last):
  File "/usr/local/bin/nova", line 6, in <module>
    from novaclient.shell import main
  File "/Library/Python/2.7/site-packages/novaclient/__init__.py", line 15, in <module>
    import pbr.version
ImportError: No module named pbr.version


在我的研究中,我发现有关pbr的信息相互矛盾,有人说它是nova所必需的,而另一些人说它不是nova所必需的。

https://github.com/rackspace/pyrax/issues/121

尝试安装pbr时,出现以下错误。

foo@bar-macbook-pro:~$ sudo python ~/Downloads/pbr/setup.py  install
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    **util.cfg_to_args())
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/util.py", line 241, in cfg_to_args
    pbr.hooks.setup_hook(config)
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/__init__.py", line 27, in setup_hook
    metadata_config.run()
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/base.py", line 29, in run
    self.hook()
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/metadata.py", line 28, in hook
    self.config['name'], self.config.get('version', None))
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 817, in get_version
    version = _get_version_from_git(pre_version)
  File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 776, in _get_version_from_git
    "git --git-dir=\"" + git_dir + "\" describe --always").replace(
  File "/Volumes/WDBlack750/spencerowen/Downloads/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


有什么明显的东西可以解释为什么我无法安装该库吗?

当然,我一定不是第一个尝试在OS X上安装nova的人。

最佳答案

一年多以后,我终于在OS X Yosemite上开始工作了

sudo pip install python-novaclient


我不必安装pbr。

10-08 10:58