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

Bug with GTK import #3

Open
RobQuistNL opened this issue Mar 11, 2024 · 6 comments
Open

Bug with GTK import #3

RobQuistNL opened this issue Mar 11, 2024 · 6 comments

Comments

@RobQuistNL
Copy link

See https://answers.launchpad.net/ubuntu/+question/327554

indicator-cpufreq.desktop[3450]: /usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:20: 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.
indicator-cpufreq.desktop[3450]: from gi.repository import Gtk
indicator-cpufreq.desktop[3450]: Traceback (most recent call last):
indicator-cpufreq.desktop[3450]: File "/usr/lib/python3/dist-packages/gi/importer.py", line 142, in load_module
indicator-cpufreq.desktop[3450]: introspection_module = get_introspection_module(namespace)
indicator-cpufreq.desktop[3450]: File "/usr/lib/python3/dist-packages/gi/module.py", line 257, in get_introspection_module
indicator-cpufreq.desktop[3450]: module = IntrospectionModule(namespace, version)
indicator-cpufreq.desktop[3450]: File "/usr/lib/python3/dist-packages/gi/module.py", line 109, in __init__
indicator-cpufreq.desktop[3450]: repository.require(namespace, version)
indicator-cpufreq.desktop[3450]: gi.RepositoryError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded
indicator-cpufreq.desktop[3450]: During handling of the above exception, another exception occurred:
indicator-cpufreq.desktop[3450]: Traceback (most recent call last):
indicator-cpufreq.desktop[3450]: File "/usr/bin/indicator-cpufreq", line 77, in <module>
indicator-cpufreq.desktop[3450]: from indicator_cpufreq.indicator import MyIndicator
indicator-cpufreq.desktop[3450]: File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 21, in <module>
indicator-cpufreq.desktop[3450]: from gi.repository import AppIndicator3 as appindicator
indicator-cpufreq.desktop[3450]: File "/usr/lib/python3/dist-packages/gi/importer.py", line 144, in load_module
indicator-cpufreq.desktop[3450]: raise ImportError(e)
indicator-cpufreq.desktop[3450]: ImportError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded
@alexanderankin
Copy link

have you tried following the instructions in the README? i did to no success, going to try reinstalling from ubuntuunity.org next

@xuancong84
Copy link
Owner

xuancong84 commented Apr 1, 2024

I did make it work on GTK 3.0 when it came over GTK 2.0 last time round. But now it happens again for going from GTK 3.0 to 4.0. So blame those stupid GTK maintainers for making their stupid 'production' so stupid in legacy compatibility. FYI, I am using my indicator-cpufreq right now everyday because my MX-Linux (Debian Bullseye) is still on GTK 3.0.

@alexanderankin
Copy link

Hi Wang, thanks for taking the time to reply- and yes, i will blame gtk based on my experiences as well.

@nazar-pc
Copy link

315af22 fixes it, I had the same issue with version from Ubuntu 22.04 repos and I just patched it accordingly

@xuancong84
Copy link
Owner

Thanks, @nazar-pc for the patch. Strangely speaking, even without patching, it works out right away on my Ubuntu 22.04 with KDE plasma desktop environment. Maybe Gnome uses a higher version GTK?

@nazar-pc
Copy link

nazar-pc commented Apr 22, 2024

I'm using a custom DE, but with Gnome components and I do have GTK4 installed. Not sure if that is the default though, I did some development with GTK4 and might have installed something that would not be shipped out of the box, but since those can be pulled by some dependencies, I'd expect many users to be affected.

P.S. I should thank you, that is the latest commit in this repo 🙂

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

4 participants