Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: cannot load library 'pango-1.0-0' #68

Open
augustus-thomas opened this issue Feb 25, 2024 · 2 comments
Open

OSError: cannot load library 'pango-1.0-0' #68

augustus-thomas opened this issue Feb 25, 2024 · 2 comments
Labels

Comments

@augustus-thomas
Copy link

Usage

I am using this repository as a package after installing with pip3 install md2pdf
I am importing the package as suggested in the Readme with from md2pdf.core import md2pdf

OS

I am running Windows Subsystem for Linux

Traceback

Traceback (most recent call last):                                                     
  File "<stdin>", line 1, in <module>                                                  
  File "/mnt/c/Users/augus/noteworthy/backend.py", line 7, in <module>                 
    from md2pdf.core import md2pdf                                                     
  File "/home/awth/.local/lib/python3.10/site-packages/md2pdf/__init__.py", line 7, in 
<module>                                                                               
    from .core import md2pdf  # noqa                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/md2pdf/core.py", line 5, in <module>                                                                                   
    from weasyprint import HTML, CSS                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/__init__.py", line 419, in <module>                                                                         
    from .css import preprocess_stylesheet  # noqa isort:skip                          
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/css/__init__.py", line 27, in <module>                                                                      
    from .computed_values import COMPUTER_FUNCTIONS                                    
  File "/home/awth/.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 "/home/awth/.local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 431, in <module>                                                                         
    pango = _dlopen(                                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 417, in _dlopen                                                                          
    return ffi.dlopen(names[0])  # pragma: no cover                                    
  File "/home/awth/.local/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen                                                                                      
    lib, function_cache = _make_ffi_library(self, name, flags)                         
  File "/home/awth/.local/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library                                                                           
    backendlib = _load_backend_lib(backend, libname, flags)                            
  File "/home/awth/.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': pango-1.0-0: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'
@jmaupetit
Copy link
Owner

Hi @augustus-thomas!

This issue is related to WeasyPrint! Did you follow the installation instructions from the documentation? Pay attention to the GTK3 requirement.

@rcking
Copy link

rcking commented May 26, 2024

Thank you - but WeasyPrint in turn depends on pango, and it is not obvious how to install that. For Ubuntu 20.04 and 22.04 I found this article. In short, for 22.04:

sudo apt-get -y install libcogl-pango-dev

worked for me. Not perfect, as it is outside of the virtual environment. But now md2pdf works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants