Open qiuqiufrank opened 3 years ago
How to solve this problem?
This seems to be an EasyPrint issue. Please check Weasy print document.
I had a similar issue (with lib gobject.so.2) and it was because weasyprint requires a GTK3 runtime which needs to be installed on Windows: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer
After installing, it worked fine and it might be the same reason here.
enviroment: Windows10, Python3.9.5 cmd: mkdocs.exe build error:
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, *ctx.params) File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\click\core.py", line 763, in invoke return __callback(args, kwargs) File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\mkdocs__main__.py", line 183, in build_command build.build(config.load_config(kwargs), dirty=not clean) File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\mkdocs\commands\build.py", line 249, in build config = config['plugins'].run_event('config', config) File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\mkdocs\plugins.py", line 94, in run_event result = method(item, **kwargs) File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\mkdocs_pdf_export_plugin\plugin.py", line 42, in on_config from .renderer import Renderer File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\mkdocs_pdf_export_plugin\renderer.py", line 6, in
from weasyprint import HTML
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\weasyprint__init.py", line 469, in
from .css import preprocess_stylesheet # noqa isort:skip
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\weasyprint\css__init.py", line 27, in
from . import computed_values, counters, media_queries
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\weasyprint\css\computed_values.py", line 15, in
from .. import text
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\weasyprint\text.py", line 11, in
import cairocffi as cairo
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\cairocffi\ init__.py", line 48, in
cairo = dlopen(
File "d:\hzh_sfq\projects\shenzhen\docs\venv\lib\site-packages\cairocffi\ init__.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e