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 '3.0', but '4.0' is already loaded #89

Closed
Glitchii opened this issue May 25, 2023 · 2 comments
Labels

Comments

@Glitchii
Copy link

Glitchii commented May 25, 2023

Bug description

Got this issue after reinstalling to Ubuntu 23.04. I sure I'm just too early and this will be fixed in the future since Ubuntu 23.04 is quite new. I'm using Gnome 44. This seems like a GTK issue. I guess it expected GTK 3.0 but I'm running 4.0?

What happened

Ran nautilus -q after installing nautilus-terminal with command pip install nautilus-terminal --break-system-packages.
Received this error:

** Message: 16:58:21.060: Connecting to org.freedesktop.Tracker3.Miner.Files
/home/john/.local/lib/python3.11/site-packages/nautilus_terminal/crowbar.py:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 142, in load_module
    introspection_module = get_introspection_module(namespace)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gi/module.py", line 263, in get_introspection_module
    module = IntrospectionModule(namespace, version)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gi/module.py", line 110, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/john/.local/share/nautilus-python/extensions/nautilus_terminal_extension.py", line 22, in <module>
    from nautilus_terminal.crowbar import Crowbar  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/.local/lib/python3.11/site-packages/nautilus_terminal/crowbar.py", line 5, in <module>
    from .nautilus_terminal import create_or_update_natilus_terminal
  File "/home/john/.local/lib/python3.11/site-packages/nautilus_terminal/nautilus_terminal.py", line 14, in <module>
    from gi.repository import GLib, Gio, Gtk, Gdk, Vte, Pango  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 144, in load_module
    raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded

What was expected

nautilus to exit with no error, so that opening it back shows the terminal, which never happened.

Step to reproduce

→ Install Ubuntu 23.04, or upgrade with do-dist-upgrade, or I guess use GTK version 4.0 and above
→ Install nautilus as normal. The issue should happen after running nautilus -q after the previous steps

System information

NAUTILUS TERMINAL
=================
Version: 4.1.0
System-wide extension: Absent
Current user extension: Installed
Installation path: /home/me/.local/lib/python3.11/site-packages/nautilus_terminal

OPERATING SYSTEM
================
OS: Linux
Platform: Linux-6.2.0-20-generic-x86_64-with-glibc2.37
Version: #20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  6 07:48:48 UTC 2023
Distribution issue: Ubuntu 23.04 \n \l

PYTHON
======
Python version: 3.11.2

SYSTEM DEPENDENCIES
===================
Nautilus Python: Absent
GLib schemas compiler: Installed
@Glitchii Glitchii added the bug label May 25, 2023
@flozz
Copy link
Owner

flozz commented May 26, 2023

Hello,

As stated at the top of the README and in this issue, Nautilus Terminal is not working anymore since Nautilus 43 (when it switched to GTK 4). There will be no update since required APIs were removed from Nautilus.

You can also read this thread on the GNOME's forums:

@flozz
Copy link
Owner

flozz commented Oct 22, 2023

I close this issue as there is no activity

@flozz flozz closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants