将novaclient库导入python时出错

时间:2022-10-18 02:46:10

I am importing novalient API library to python 2.7.3 as follows

我将novalient API库导入到python 2.7.3,如下所示

from novaclient.v1_1 import client

when i try this this , it gives me following error

当我试试这个时,它给了我以下错误

Traceback (most recent call last):


File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/novaclient/__init__.py", line 18, in <module>
__version__ = pbr.version.VersionInfo('python-novaclient').version_string()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 78, in version_string
for part in self.release_string().split('.'):
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 70, in release_string
self.release = self._get_version_from_pkg_resources()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources
return packaging.get_version(self.package)
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 861, in get_version
version = _get_version_from_git(pre_version)
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 802, in _get_version_from_git
git_dir = _get_git_directory()
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 215, in _get_git_directory
return _run_shell_command(['git', 'rev-parse', '--git-dir'])
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 204, in _run_shell_command
env=newenv)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

how to solve this issue? Is this a version related issue ?

怎么解决这个问题?这是与版本相关的问题吗?

1 个解决方案

#1


1  

You can read more about pbr (Python Build Reasonableness) here: http://docs.openstack.org/developer/pbr/

您可以在此处阅读有关pbr(Python Build Reasonableness)的更多信息:http://docs.openstack.org/developer/pbr/

#1


1  

You can read more about pbr (Python Build Reasonableness) here: http://docs.openstack.org/developer/pbr/

您可以在此处阅读有关pbr(Python Build Reasonableness)的更多信息:http://docs.openstack.org/developer/pbr/