1

When I compiling libvirt code from github,There are the following errors:

[395/1071] Generating 'docs/committer-guidelines.html.p/committer-guidelines.html.in'.
FAILED: docs/committer-guidelines.html.p/committer-guidelines.html.in
/usr/bin/meson --internal exe --capture docs/committer-guidelines.html.p/committer-guidelines.html.in -- /usr/local/bin/rst2html5 --stylesheet= --strict ../docs/committer-guidelines.rst
Traceback (most recent call last):
  File "/usr/local/bin/rst2html5", line 7, in <module>
    from rst2html5_ import main
  File "/usr/local/lib/python3.6/site-packages/rst2html5_.py", line 17, in <module>
    from rst2html5 import HTML5Writer  # noqa E402
  File "/usr/local/lib/python3.6/site-packages/rst2html5/__init__.py", line 4, in <module>
    from importlib import metadata
ImportError: cannot import name 'metadata'
[422/1071] Compiling C object src/conf/libvirt_conf.a.p/domain_conf.c.o
ninja: build stopped: subcommand failed.

I have tried some ways,but it didn't solve the problem

  1. pipenv install jsonschema==3.0.2 from this

  2. update python version to 3.8

Compile Environment: centos 8; linux 5.14.7; python 3.6.8; libvirt main

2 Answers2

0

Try updating your rst2html5 package:

pip install rst2html5
Max Daroshchanka
  • 2,698
  • 2
  • 10
  • 14
  • Hi, sorry for late to feedback, The question is solved when I reinstalled the entire python environment, maybe the reason for a certain component version does not correspond. I have installed the rst2html5 before, but it didn't work, but your idea is right, there is something wrong with a component. thank you a lot. – user17057376 Mar 28 '22 at 02:41
0

Could you try this method: In file of /usr/local/lib/python3.6/site-packages/rst2html5/init.py modify to:

try:
    from importlib import metadata
except ImportError:
    # Running on pre-3.8 Python; use importlib-metadata package
    import importlib_metadata as metadata  # type: ignore

https://gitlab.com/meltano/sdk/-/issues/58

Boyuan Niu
  • 16
  • 1