0

我收到以下错误,如何纠正此问题?

 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
4

1 回答 1

1

您缺少 ovirt-engine-sdk-python 软件包。请注意,它需要该软件包的版本 3,因此您可以像这样通过 pip 安装它:

$ pip install ovirt-engine-sdk-python==3.6.9.2

不要运行:

$ pip install ovirt-engine-sdk-python

这将安装与上述代码不兼容的最新(4)版本的 SDK。

于 2019-01-03T12:28:34.873 回答