useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
36 stars 15 forks source link

Pango missing (by weasyprint) #6

Closed danwos closed 1 year ago

danwos commented 2 years ago
make simplepdf
Sto eseguendo Sphinx v5.1.1
sto creando la cartella di output... fatto
loading pickled environment... fatto
Setting theme to sphinx_simplepdf
Generating css files from scss-templates
building [mo]: targets for 0 po files that are out of date
building [simplepdf]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... fatto
assembling single document... fatto
writing... fatto
writing additional files... fatto
copying static files... fatto
copying extra files... fatto
dumping object inventory... fatto
Traceback (most recent call last):
  File "/usr/local/bin/weasyprint", line 5, in <module>
    from weasyprint.__main__ import main
  File "/usr/local/lib/python3.10/site-packages/weasyprint/__init__.py", line 336, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "/usr/local/lib/python3.10/site-packages/weasyprint/css/__init__.py", line 25, in <module>
    from . import computed_values, counters, media_queries
  File "/usr/local/lib/python3.10/site-packages/weasyprint/css/computed_values.py", line 9, in <module>
    from ..text.ffi import ffi, pango, units_to_double
  File "/usr/local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 401, in <module>
    pango = _dlopen(
  File "/usr/local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 385, in _dlopen
    return ffi.dlopen(names[0])  # pragma: no cover
  File "/usr/local/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/usr/local/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/usr/local/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'pango-1.0-0': dlopen(pango-1.0-0, 0x0002): tried: '/usr/local/lib/pango-1.0-0' (no such file), 'pango-1.0-0' (no such file), '/usr/local/lib/pango-1.0-0' (no such file), '/usr/lib/pango-1.0-0' (no such file), '/Users/renatopontefice/sphinx/docs/pango-1.0-0' (no such file).  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'
build succeeded.

Bug reported by user.

looks like weasyprint needs a pango-lib for the build.

We need to check:

Sachin-Suresh commented 1 year ago

I recently faced this is Mac 12.5 version. I had to do this to get it fixed:

brew install pango

Hope this works? @danwos

danwos commented 1 year ago

@Sachin-Suresh Thanks for the hint with brew. I added it to the docs.

I see this problem more as an upstream problem of the used weasyprint lib, so it is not caused by SimplePDF and can therefore not be solved by it. I close this issue.