Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

444
Views
gobject-2.0-0 not able to load on macbook

I am facing this error when I start my flask python3 application on mac.

OSError: cannot load library 'gobject-2.0-0': dlopen(gobject-2.0-0, 2): image not found. Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0-0'

I am using weasyprint in my project which is causing this issue.

I tried to install glib and it is installed in my system

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I just managed the same issue on my Mac M1.

The problem was that symlinks to the libraries were not created (can't say should it be done by homebrew or weasyprint when installation).

So, I had to do it manually

sudo ln -s /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib /usr/local/lib/gobject-2.0
sudo ln -s /opt/homebrew/opt/pango/lib/libpango-1.0.dylib /usr/local/lib/pango-1.0
sudo ln -s /opt/homebrew/opt/harfbuzz/lib/libharfbuzz.dylib /usr/local/lib/harfbuzz
sudo ln -s /opt/homebrew/opt/fontconfig/lib/libfontconfig.1.dylib /usr/local/lib/fontconfig-1
sudo ln -s /opt/homebrew/opt/pango/lib/libpangoft2-1.0.dylib /usr/local/lib/pangoft2-1.0

This solved the problem.

In order to TEST if Python can find the library you may run

from ctypes.util import find_library

find_library('gobject-2.0')  # Pass any other lib name as an argument
over 4 years ago · Santiago Trujillo Report

0

If you installed weasyprint package in your virtual env but did not installed some required packages for that, then that might be the reason. It was actually, in my case.

If you're mac user you need install pango and libffi, not to mention python as well.

Installation guide on mac

brew install python pango libffi
(venv) pip install weasyprint
over 4 years ago · Santiago Trujillo Report

0

I had the same issue after the homebrew update. Turned out the issue was because of the older pango lib version.

I did brew install pango

This upgraded pango lib from 1.48.2 -> 1.50.4 which internally installed gobject's latest version as dep. And my issue got resolved.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!