-
-
Notifications
You must be signed in to change notification settings - Fork 684
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-0': error 0x7e #1556
Comments
I've met a similar issue on macOS x86_64 in a pure virtualenv environment.
|
This problem means that gobject is not found. The solution to solve that is different on Windows and on macOS. @jancoow Do you use WeasyPrint 54.0? @zhangkaizhao You have to use Homebrew’s Python to create your virtual environment, not another Python installed somewhere else. You’ll find more information in #1483. |
I'm using the latest version, installed with pip3 install weasyprint |
@jancoow OK. Did you install GTK in the default directory ( |
Yes, I did. I verified and I can see the gobject DLL in the bin directory. |
Hmmm, version 54.0 should then work out of the box with Python 3.8 or more recent… Do you use the 64-bit version of Python on a 64-bit version of Windows? |
That is a good question! I did check if I have 64 bit Windows, but totally forget to check if I'm running a 64 bit version of python. I'll have to check tomorrow. |
Did you find the time to check this? |
Don’t hesitate to reopen if needed! |
I am also facing the same problem. Running solution on the newest Mac book pro M1. Simply can't run it locally. |
The problem is generally caused by not using Homebrew’s Python 3 to create the virtual environment. What does |
Just fixed it using: sudo ln -s /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib /usr/local/lib/gobject-2.0 Solution: #1448 |
It’s cool if it works for you. Using Hombrew’s Python to create the virtual environment avoids the need to link libraries. It will also avoid the risk to break Homebrew, WeasyPrint or your whole system when you upgrade Homebrew packages. I really wouldn’t do this on my system, but it’s up to you 😄. |
It's working for me, thanks a lot |
When my venv is not activated, Can you explain your proposed method of "using Homebrew's Python" to create the venv? EDIT: I experimented with installing python with homebrew and using homebrew's |
What you have to do is to follow the installation guide:
Following these steps is not mandatory, there are endless solutions to make WeasyPrint work on macOS. But that’s the "official" way we can help users to follow, because we know that it’s safe and reliable. |
This work for me on Mac M1 Pro. |
Hi I am facing this on ubuntu 20.0 |
this works on Mac M3. Thanks |
I'm still facing issues in windows 11 |
Please follow the install steps. If it doesn’t work, please open a new issue. |
Hi,
I'm trying to install weasyprint on Windows, but I'm unable to. On Linux it's working fine.
I'm getting this error:
OSError: cannot load library 'gobject-2.0-0': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0-0'
I've installed gtk3-runtime according the documentation but it's unable to find the bin directory. I've tried both python3.7 as python3.8 with no luck.
The text was updated successfully, but these errors were encountered: