Edinburgh-Genome-Foundry / pdf_reports

:closed_book: Python library and CSS theme to generate PDF reports from HTML/Pug

Home Page:https://edinburgh-genome-foundry.github.io/pdf_reports/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install pango on macOS

simone-pignotti opened this issue · comments

Hi,
On macOS, importing pdf_reports without pango installed results in:

>>> import pdf_reports
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/pdf_reports/__init__.py", line 1, in <module>
    from .pdf_reports import (pug_to_html, write_report, ReportWriter, GLOBALS,
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/pdf_reports/pdf_reports.py", line 3, in <module>
    from weasyprint import HTML, CSS
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/weasyprint/__init__.py", line 441, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/weasyprint/css/__init__.py", line 30, in <module>
    from . import computed_values, media_queries
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/weasyprint/css/computed_values.py", line 17, in <module>
    from .. import text
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/weasyprint/text.py", line 259, in <module>
    'libpango-1.0.dylib')
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/weasyprint/text.py", line 253, in dlopen
    return ffi.dlopen(names[0])  # pragma: no cover
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/cffi/api.py", line 146, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/cffi/api.py", line 828, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Users/simonepignotti/.conda/envs/rescod/lib/python3.7/site-packages/cffi/api.py", line 823, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'pango-1.0': dlopen(pango-1.0, 2): image not found.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0'

Clearly this is not a problem of pdf_reports, but I think it would be useful to add a recommended solution (e.g. brew install pango) to the docs, after the note about libffi-dev for Debian.

Thank you so much for all the great tools you are maintaining!

Simone

commented

Thanks for the report, I have added a note to "brew install pango" in the readme.

Great, thank you!