2

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

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

python --version
Python 2.7.2

我成功安装了 nova(安装 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 的人。

4

2 回答 2

2

一年多后,我终于在 OS X Yosemite 上运行了

sudo pip install python-novaclient

我不必安装 pbr。

于 2014-10-29T20:08:42.597 回答
0

我做了基于venv的安装:

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

就我而言,我有一个混合python使用,通过fabric全局安装的方式使用。

之前:rf -rf我所有的 virtualenvs,rf -rf所有对 novaclient 的引用(本地和全局),并删除了fabric调用 novaclient 的全局安装。

同样作为预防措施,我没有全局安装 pip,并且只在 virtualenvs 中不使用 sudo 使用它。

于 2016-12-19T19:51:49.920 回答