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

ImportError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded #330

Closed
bbhtt opened this issue Oct 1, 2022 · 4 comments

Comments

@bbhtt
Copy link
Contributor

bbhtt commented Oct 1, 2022

Trying to use the GNOME 43 runtime results in:

Traceback (most recent call last):
  File "/app/bin/eos-photos", line 12, in <module>
    from src.endless_photos import EndlessPhotos
  File "/app/share/eos-photos/src/endless_photos.py", line 9, in <module>
    from .photos_view import PhotosView
  File "/app/share/eos-photos/src/photos_view.py", line 11, in <module>
    from .share.facebook_auth_dialog import FacebookAuthDialog
  File "/app/share/eos-photos/src/share/facebook_auth_dialog.py", line 2, in <module>
    from gi.repository import Gtk, WebKit2
  File "/usr/lib/python3.10/site-packages/gi/importer.py", line 144, in load_module
    raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded
@wjt
Copy link
Member

wjt commented Oct 3, 2022

Try 9aacc1d ?

@bbhtt
Copy link
Contributor Author

bbhtt commented Oct 3, 2022

I tried that locally, it didn't work. I'll start a build with it to test.

@bbhtt
Copy link
Contributor Author

bbhtt commented Oct 3, 2022

Yea same issue with 113671:

flatpak run com.endlessm.photos
/app/share/eos-photos/src/endless_photos.py:6: PyGIWarning: GtkClutter was imported without specifying a version first. Use gi.require_version('GtkClutter', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk, GLib, GtkClutter, GObject, Gio, Endless
/app/share/eos-photos/src/endless_photos.py:6: PyGIWarning: Endless was imported without specifying a version first. Use gi.require_version('Endless', '0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk, GLib, GtkClutter, GObject, Gio, Endless
/app/share/eos-photos/src/widgets/composite_button.py:40: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  set_value = (my_flag is not 0)
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/gi/importer.py", line 142, in load_module
    introspection_module = get_introspection_module(namespace)
  File "/usr/lib/python3.10/site-packages/gi/module.py", line 257, in get_introspection_module
    module = IntrospectionModule(namespace, version)
  File "/usr/lib/python3.10/site-packages/gi/module.py", line 109, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/bin/eos-photos", line 12, in <module>
    from src.endless_photos import EndlessPhotos
  File "/app/share/eos-photos/src/endless_photos.py", line 9, in <module>
    from .photos_view import PhotosView
  File "/app/share/eos-photos/src/photos_view.py", line 13, in <module>
    from .share.facebook_auth_dialog import FacebookAuthDialog
  File "/app/share/eos-photos/src/share/facebook_auth_dialog.py", line 4, in <module>
    from gi.repository import Gtk, WebKit2
  File "/usr/lib/python3.10/site-packages/gi/importer.py", line 144, in load_module
    raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded

@bbhtt
Copy link
Contributor Author

bbhtt commented May 13, 2023

This patch and the suggestion by @dbnicholson to specify the Gdk version seems to have worked.

flathub/com.endlessm.photos@6667733 (ignore the whitespace trimmings at line endings)

@wjt wjt closed this as completed in 9aacc1d May 16, 2023
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

2 participants