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

gobject-introspection v1.80 compat error ("gi.RepositoryError: Typelib file for namespace 'GObject', version '2.0' not found") #252

Open
samtuke opened this issue Mar 28, 2024 · 4 comments

Comments

@samtuke
Copy link

samtuke commented Mar 28, 2024

I'm getting this error on Mac M2 hardware today. I've been running gtimelog from git for months, not sure what's causing it. libx11 was upgraded also today, in case that's related by any chance. Ideas?

~/D/gtimelog (master)> gtimelog
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/gi/importer.py", line 139, in create_module
    introspection_module = get_introspection_module(namespace)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/gi/module.py", line 263, in get_introspection_module
    module = IntrospectionModule(namespace, version)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/gi/module.py", line 110, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Typelib file for namespace 'GObject', version '2.0' not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/gtimelog", line 5, in <module>
    from gtimelog.main import main
  File "/opt/homebrew/lib/python3.11/site-packages/gtimelog/main.py", line 72, in <module>
    from gi.repository import Gdk, Gio, GLib, GObject, Gtk, Pango, Soup
  File "/opt/homebrew/lib/python3.11/site-packages/gi/importer.py", line 141, in create_module
    raise ImportError(e)
ImportError: Typelib file for namespace 'GObject', version '2.0' not found
@sallner
Copy link

sallner commented Apr 5, 2024

Hello,
I got the same error. It is actually the version 1.80 of gobject-introspection, which does not well with gtimelog.

My workaround was to downgrade to 1.78.1. If you use homebrew, those steps might help, as long no other dependency needs the new gobject-introspection version. I pinned the version in the last step to avoid another automatic upgrade.

brew info gobject-introspection
# Uninstall the old version. Alternatively `unlink` could also work.
brew uninstall gobject-introspection
curl -o gobject-introspection.rb  https://raw.githubusercontent.com/Homebrew/homebrew-core/abdcdb4613d762c58b0d59ae97f34e92e00f493d/Formula/g/gobject-introspection.rb
brew install -s gobject-introspection.rb
brew pin gobject-introspection

@samtuke
Copy link
Author

samtuke commented Apr 5, 2024

@sallner That worked! Awesome; thanks for taking the time to share 🙏

@samtuke
Copy link
Author

samtuke commented Apr 5, 2024

Not sure whether to close this (due to the workaround) or not... I'll change the issue name to make it more relevant for the future, and keep it open (maintainers: feel free to close instead, of course).

@samtuke samtuke changed the title gi.RepositoryError: Typelib file for namespace 'GObject', version '2.0' not found gobject-introspection v1.80 compat error ("gi.RepositoryError: Typelib file for namespace 'GObject', version '2.0' not found") Apr 5, 2024
@mgedmin
Copy link
Member

mgedmin commented Apr 8, 2024

gi.RepositoryError: Typelib file for namespace 'GObject', version '2.0' not found

I'm not familiar with Homebrew, but this error means the GObject-2.0.typelib file is not installed. On Ubuntu it's provided by the gir1.2-glib-2.0 package and resides in /usr/lib/x86_64-linux-gnu/girepository-1.0/

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

3 participants