我得到以下错误,如何纠正这个问题?
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
这是完整的日志文件,为什么我会出现这个错误以及如何纠正它?
python manage.py createcachetable
Traceback (most recent call last):
File "manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/hari/openuds/testuds-master/Python-2.7.14/env/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/hari/openuds/testuds-master/server/src/uds/__init__.py", line 72, in ready
from . import services # to make sure that the packages are initialized at this point
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 73, in <module>
__init__()
File "/home/hari/openuds/testuds-master/server/src/uds/services/__init__.py", line 63, in __init__
__import__('uds.services.' + name, globals(), locals(), [])
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/__init__.py", line 31, in <module>
from .OVirtProvider import Provider
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/OVirtProvider.py", line 44, in <module>
from . import client
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/__init__.py", line 33, in <module>
from . import oVirtClient3;
File "/home/hari/openuds/testuds-master/server/src/uds/services/OVirt/client/oVirtClient3.py", line 7, in <module>
from ovirtsdk.xml import params
ImportError: No module named ovirtsdk.xml
您缺少ovirt engine sdk python包。注意,它需要该软件包的版本3,所以你可以通过这样的pip安装它:
$ pip install ovirt-engine-sdk-python==3.6.9.2
不运行:
$ pip install ovirt-engine-sdk-python
它将安装与上述代码不兼容的最新(4(版本的SDK。