Solved weasyprint

Hi, I installed weasyprint with pip-3.8 install weasyprint (also with pkg install weasyprint), when I try to run it I get:

Code:
Traceback (most recent call last):
  File "/usr/local/bin/weasyprint", line 5, in <module>
    from weasyprint.__main__ import main
  File "/usr/local/lib/python3.8/site-packages/weasyprint/__init__.py", line 322, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "/usr/local/lib/python3.8/site-packages/weasyprint/css/__init__.py", line 27, in <module>
    from . import computed_values, counters, media_queries
  File "/usr/local/lib/python3.8/site-packages/weasyprint/css/computed_values.py", line 16, in <module>
    from ..text.ffi import ffi, pango, units_to_double
  File "/usr/local/lib/python3.8/site-packages/weasyprint/text/ffi.py", line 383, in <module>
    pango = _dlopen(
  File "/usr/local/lib/python3.8/site-packages/weasyprint/text/ffi.py", line 377, in _dlopen
    return ffi.dlopen(names[0])  # pragma: no cover
  File "/usr/local/lib/python3.8/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/usr/local/lib/python3.8/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/usr/local/lib/python3.8/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'pango-1.0-0': Shared object "pango-1.0-0" not found, required by "python3.8".  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'

Pango is already installed:
Code:
pkg install pango
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

Can anyone help me with this?.

I'm running 12.2-RELEASE-p10 without X11 installed.
 
Code:
pkg info pango
pango-1.48.7
Name           : pango
Version        : 1.48.7
Installed on   : Mon Oct 11 21:57:20 2021 -03
Origin         : x11-toolkits/pango
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : x11-toolkits
Licenses       : LGPL20
Maintainer     : desktop@FreeBSD.org
WWW            : http://www.pango.org/
Comment        : Open-source framework for the layout and rendering of i18n text
Options        :
        DOCS           : on
        X11            : on
Shared Libs required:
        libfontconfig.so.1
        libglib-2.0.so.0
        libgobject-2.0.so.0
        libXrender.so.1
        libfreetype.so.6
        libfribidi.so.0
        libharfbuzz.so.0
        libcairo.so.2
        libgio-2.0.so.0
        libXft.so.2
        libX11.so.6
Shared Libs provided:
        libpangoxft-1.0.so.0
        libpangoft2-1.0.so.0
        libpangocairo-1.0.so.0
        libpango-1.0.so.0
Annotations    :
        FreeBSD_version: 1202000
        cpe            : cpe:2.3:a:gnome:pango:1.48.7:::::freebsd12:x64
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 12.3MiB
Description    :
Pango provides a framework to render and control the layout of
internationalized text, and is the backend for right-to-left text.
Pango is an integral part of the GTK+ and GNOME projects, but its
code is platform- and toolkit-independent.

WWW: http://www.pango.org/
 
pip-3.8 install weasyprint (also with pkg install weasyprint),

In which order?

For pip, did you use a normal user account (not root)?

Here, without using pip, a test result, problem-free:

1634860923488.png
 
In which order?

For pip, did you use a normal user account (not root)?

Here, without using pip, a test result, problem-free:

View attachment 11788
To try again I removed weasyprint, then pkg install weasyprint, after that I run it and got the same OSError: cannot load library 'libpango-1.0.so.0': /usr/local/lib/libpango-1.0.so.0: Undefined symbol "g_memdup2".
 
Try:
  1. create, activate then boot a new ZFS boot environment
  2. pkg upgrade -f
  3. reboot


Using pip?

Thanks with pkg upgrade -f I got rid of the Pango error, then I installed weasyprint with pip-3.8 install weasyprint because it allows me to install version 53, while using pkg it installs version 51.
 
Back
Top