Skip to content

[Bug]: Unit tests: MacOS 14 failures: gi-invoke-error-quark #29732

Open

Description

@jayaddison

Bug summary

During a recent GitHub Actions workflow for unrelated pull request #29721, the following error appeared:

E           gi._error.GError: gi-invoke-error-quark: Could not locate g_option_error_quark: dlopen(libglib-2.0.0.dylib, 0x0009): tried: 'libglib-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglib-2.0.0.dylib' (no such file), '/usr/lib/libglib-2.0.0.dylib' (no such file, not in dyld cache), 'libglib-2.0.0.dylib' (no such file) (1)

Code for reproduction

This occurred for Python3.12 and Python3.13 on MacOS 14:

Actual outcome

See the error in the main description and linked build logs.

Expected outcome

The tests should pass as expected (the error appears to be a transient failure to locate/load a dynamic library file).

Additional information

N/A

Operating system

MacOS 14

Matplotlib Version

86fd11f

Matplotlib Backend

N/A

Python version

No response

Jupyter version

N/A

Installation

None

Edit: remove code-block markup surrounding non-code details
Edit: the failure appears to occur fairly reliably, so remove the description of it as transient

Activity

  1. jayaddison commented on Mar 11, 2025

    @jayaddison
    ContributorAuthor

    I think that the libglib-2.0.0.dylib linked library file that appears to be missing (dlopen fails to find it) should be provided by the glib Homebrew package, pulled in as a dependency of ffmpeg.

    Version 2.84.0 of glib was installed during both failed tests reported by this bug -- meanwhile, version 2.82.5 of glib was installed during one of the recent successful MacOS 14 pipelines on the mainline branch.

    A next step could be to confirm whether the library file was included in the updated Brew package -- and if so, whether it was on the library load search path.

  2. jayaddison commented on Mar 11, 2025

    @jayaddison
    ContributorAuthor

    I think that the libglib-2.0.0.dylib linked library file that appears to be missing (dlopen fails to find it) should be provided by the glib Homebrew package, pulled in as a dependency of ffmpeg.

    Hmm.. an earlier error hints at PyGObject as potentially more relevant:

    gi._error.GError: gi-invoke-error-quark: Could not locate g_option_error_quark: dlopen(libglib-2.0.0.dylib, 0x0009): tried: 'libglib-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglib-2.0.0.dylib' (no such file), '/usr/lib/libglib-2.0.0.dylib' (no such file, not in dyld cache), 'libglib-2.0.0.dylib' (no such file) (1)
    PyGObject 4 is not available
    

    (contrastingly, that message does not appear during the successful build - there we find PyGObject 4 is available instead)

    I think this may be something to do with a recent dependency version upgrade taking place in GObject>=3.51:

    I plan to open an experimental pull request to place an upper limit on the PyGObject package version installed during GitHub Actions unit testing, to learn whether that could (temporarily) resolve the issue.

  3. jayaddison commented on Mar 11, 2025

    @jayaddison
    ContributorAuthor

    I think this may be something to do with a recent dependency version upgrade taking place in GObject>=3.51:

    Pull request #29734 seems to support that theory; pinning PyGObject<3.52.0 allows the GitHub Actions tests.yml workflows to succeed for MacOS 14 (both with py3.12 and also with py3.13).

  4. jayaddison commented on Mar 12, 2025

    @jayaddison
    Author
  5. jayaddison commented on Mar 12, 2025

    @jayaddison
    Author
  6. changed the title [-][Bug]: Unit tests: transient MacOS 14 failures: gi-invoke-error-quark[/-] [+][Bug]: Unit tests: MacOS 14 failures: gi-invoke-error-quark[/+] on Mar 12, 2025
  7. jayaddison commented on Mar 12, 2025

    @jayaddison
    ContributorAuthor

    @dstansby @timhoffm thanks again - I hope to figure out where this problem originates, so that we can remove the temporary version limit in the not-too-distant future; my guess is that there'll be a bug to report in GNOME's pygobject project, but I'm not certain yet.

  8. dstansby commented on Mar 12, 2025

    @dstansby
    Member

    Fab, thanks for following up! I'll re-open this issue so we don't forget.

  9. jayaddison commented on Mar 19, 2025

    @jayaddison
    ContributorAuthor

    By removing the Homebrew-provided gobject-introspection library as part of #29777, some progress appears to be made; a different and I think deeper dependency layer of cairo is next up to fail to resolve:

    ImportError: Typelib file for namespace 'cairo', version '1.0' not found
    PyGObject 4 is not available
    

    I'd intended for solely the Homebrew-installed cairo to be provided, negating any requirement for a PyPI/pip-based install -- but it seems that pycairo was also retrieved from the Python package index:

    Collecting pycairo>=1.16 (from PyGObject)
      Using cached pycairo-1.27.0-cp313-cp313-macosx_14_0_arm64.whl
    

    I'm not sure what to do next, yet.

  10. jayaddison commented on Mar 19, 2025

    @jayaddison
    ContributorAuthor

    Note also: cairo (a linkable binary library) and py3cairo (Python bindings to that library) appear as distinct packages in Homebrew.

  11. jayaddison commented on Mar 19, 2025

    @jayaddison
    ContributorAuthor

    I am struggling to get PR #29777 to resolve this currently, and would be glad for help.

    I think that there may be an incompatibility between recent versions of PyGObject as distributed on PyPI and the cairo and pycairo bindings available from either PyPI or Homebrew -- but I don't really understand the problem loading the cairo linked library yet.

    I do note that Homebrew plans to update their own packaged version of PyGObject in the near future; so one option, if acceptable, could be to install from that instead of using pip install - either as a temporary solution until the interfaces restabilize, or longer-term if it is OK to migrate more CI dependencies to use Homebrew. The relevant Homebrew PR is: Homebrew/homebrew-core#210911

    (it is currently blocked by the fact that freedesktop.org is temporarily down for some planned maintenance as they migrate to another infrastructure hosting provider)

  12. jayaddison commented on Mar 28, 2025

    @jayaddison
    ContributorAuthor

    As a recap / status update:

  13. jayaddison commented on Mar 28, 2025

    @jayaddison
    ContributorAuthor

    Some notes/suggestions from discussion:

    • The gobject-introspection Homebrew package should be the one providing the Cairo typelib.
    • It may be worth comparing the results when using Homebrew's Python package instead of the one installed using setup-actions/python.

    I'm going to try to step away from the problem until early next week, because I think I've been getting stuck in various potentially-irrelevant details and reconsidering it from fresh may help.

  14. jayaddison commented on Apr 28, 2025

    @jayaddison
    ContributorAuthor

    (I haven't yet gotten around to that testing - I hope to soon, but I'm not sure exactly when it'll be)

  15. badrianiulian commented on Sep 4, 2025

    @badrianiulian

    I found this page by searching for this particular error while trying to run deluge inside a python 3.13 virtual environment from command line:

    ImportError: Typelib file for namespace 'cairo', version '1.0' not found
    

    This error was fixed by running brew install pygobject3 outside of the virtual environment and pip3 install PyGObject inside the virtual environment

    Maybe it helps someone.

  16. samuelhoover commented on Nov 14, 2025

    @samuelhoover

    I also came across this page for a separate reason but same error. Pinning pygobject<3.52.0 worked for me, specifically v3.50.2 (that's what version uv installed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions