indicator-cpufreq gtk

Bug #1947756 reported by Selmi
40
This bug affects 9 people
Affects Status Importance Assigned to Milestone
indicator-cpufreq (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

doesn't work in 21.10

$ indicator-cpufreq
/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.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 137, in load_module
    introspection_module = get_introspection_module(namespace)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 257, in get_introspection_module
    module = IntrospectionModule(namespace, version)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 109, 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 "/usr/bin/indicator-cpufreq", line 77, in <module>
    from indicator_cpufreq.indicator import MyIndicator
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 21, in <module>
    from gi.repository import AppIndicator3 as appindicator
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 139, in load_module
    raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: indicator-cpufreq 0.2.2-0ubuntu3
ProcVersionSignature: Ubuntu 5.13.0-19.19-generic 5.13.14
Uname: Linux 5.13.0-19-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu70
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 19 16:12:47 2021
InstallationDate: Installed on 2019-03-21 (943 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
PackageArchitecture: all
SourcePackage: indicator-cpufreq
UpgradeStatus: Upgraded to impish on 2021-10-18 (1 days ago)

Revision history for this message
Selmi (selmi) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-cpufreq (Ubuntu):
status: New → Confirmed
Revision history for this message
Mario Di Nicola (warp99) wrote :

I was able to make the python script work by editing the following file:

/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py

... and adding the following lines just below the comments that end on line 17:

import gi
gi.require_version("Gtk", "3.0")
gi.require_version('AppIndicator3', '0.1')

Revision history for this message
Michael Johnson (samualblair) wrote :

I also encountered this issue, Ubuntu 21.10. Workaround proposed by Mario Di Nicola (warp99) worked for me as well (editing the python script to import GTK 3.0).

Revision history for this message
Mmortal03 (mmortal03) wrote :

After making the suggested modification to indicator.py, it did fix the initial issue, but I'm seeing an additional error:

Traceback (most recent call last):
  File "/usr/bin/indicator-cpufreq", line 79, in <module>
    ind = MyIndicator(options.show_frequency)
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 101, in __init__
    self.update_ui()
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 125, in update_ui
    self.select_items[freq].set_active(True)
KeyError: 849165

I found someone else posting about the same additional error here, but no solution: https://askubuntu.com/questions/1092904/ubuntu-18-04-unable-to-run-indicator-cpufreq

Revision history for this message
Ricardo (rickjfer) wrote (last edit ):

On AMD's, enable “Cool n Quiet” in the BIOS.

Hey. I came here with the same problem. After changing the "indicator.py" file it didn't work.
Searching more I found a forum on the internet with a solution that worked for me.

My processor is AMD and in the BIOS the “Cool n Quiet” option was disabled and the error was exactly the same. I'm a beginner programmer and I don't program in python, but what I understand is that it can't get the frequency values, generating the error.

It would be interesting to have a check or a warning to check/enable the “Cool n Quiet” option for AMD's devices.

Sorry for my beginner english.

PS: Ubuntu 22.04.1 LTS
OS: KDE neon 5.26 x86_64
Kernel: 5.15.0-52-generic

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.