我正在为我的库存使用 ansible rax.py 脚本。我遇到的问题与ansible无关,而是与pyrax或pbr有关。
我已采取以下步骤:
sudo pip install pyrax
python
>>> import pyrax
然后我得到:
File "/Library/Python/2.7/site-packages/pbr/packaging.py", line 870, in get_version
raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
根据一些 github 问题,应该单独安装 pbr 来解决这个问题。我没有任何运气就做到了。
pip show pbr
---
Name: pbr
Version: 0.10.0
Location: /Library/Python/2.7/site-packages
Requires: pip
pip show python-novaclient
---
Name: python-novaclient
Version: 2.19.0
Location: /Library/Python/2.7/site-packages
Requires: requests, iso8601, python-keystoneclient, Babel, oslo.utils, six, simplejson, pbr, PrettyTable, argparse
我使用的是 python 2.7.5 而不是 virtualenv。任何帮助将不胜感激!
谢谢巴里