为什么我不能在OS X上安装openstack nova客户端?

时间:2013-09-09 20:00:43

标签: python openstack-nova

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

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的人。

2 个答案:

答案 0 :(得分:2)

一年后,我终于在OS X Yosemite上工作了

sudo pip install python-novaclient

我没有安装pbr。

答案 1 :(得分:0)

我基于venv进行了安装:

virtualenv venv_name
source venv_name/bin/activate
pip install python-novaclient fabric

在我的情况下,我通过全局安装python来使用fabric我正在使用的混合。

之前: rf -rf 我所有的virtualenvs, rf -rf 所有对novaclient(本地和全局)的引用,并删除了全局安装fabric正在呼唤无所不在的人。

另外作为预防措施,我不会全局安装pip,只在virtualenvs中使用它而不使用sudo。