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 'gobject-2.0' #104

Open
1 task done
BastianZim opened this issue Jun 14, 2021 · 6 comments
Open
1 task done

OSError: cannot load library 'gobject-2.0' #104

BastianZim opened this issue Jun 14, 2021 · 6 comments

Comments

@BastianZim
Copy link
Member

See conda-forge/weasyprint-feedstock#23 and https://gitter.im/conda-forge/conda-forge.github.io?at=60c76d5ed855766185d8862a

Full error:

$ python -c "import weasyprint"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/weasyprint/__init__.py", line 469, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/weasyprint/css/__init__.py", line 27, in <module>
    from . import computed_values, counters, media_queries
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/weasyprint/css/computed_values.py", line 15, in <module>
    from .. import text
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/weasyprint/text.py", line 259, in <module>
    'libgobject-2.0.dylib')
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/weasyprint/text.py", line 255, in dlopen
    return ffi.dlopen(names[0])  # pragma: no cover
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/Users/shannon/opt/miniconda3/envs/weasyprint/lib/python3.6/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'gobject-2.0': dlopen(gobject-2.0, 2): image not found.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0'
@BastianZim
Copy link
Member Author

CC @xhochy

@xhochy
Copy link
Member

xhochy commented Jun 20, 2021

This is happening because of #102, we probably should add this as a separate output so you don't need to depend on the full glib package.

@liZe
Copy link

liZe commented Nov 23, 2023

Adding glib to the list of dependencies doesn’t (always?) fix the problem, users have to reinstall the glib package after installing WeasyPrint to make it work. I don’t fully understand what the problem is, but I can try to help if there’s something I can do.

@pkgw
Copy link
Contributor

pkgw commented Nov 26, 2023

If users have to reinstall glib, that might mean that weasyprint is overwriting some files from the glib package. Can you look at the file listings associated with the weasyprint package(s) and see if there might be some kind of conflict?

@xhochy
Copy link
Member

xhochy commented Nov 27, 2023

Looking at https://conda-metadata-app.streamlit.app/?q=conda-forge%2Fnoarch%2Fweasyprint-60.1-pyhd8ed1ab_0.conda, it doesn't seem like weasyprint is a culprit. If there is a need to reinstall, it is somewhere in its dependencies.

@liZe
Copy link

liZe commented Dec 5, 2023

I’ve tried to reproduce on a fresh install of both Anaconda and Miniconda on Linux, it worked perfectly for me.

Does anyone have a way to reproduce this problem reliably?

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

No branches or pull requests

4 participants