PyGIWarning : Gtk&AppIndicator3 were imported without specifying a version first

Bug #1743208 reported by adrenochrome
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
indicator-cpufreq
New
Undecided
Unassigned

Bug Description

Hello,

i'm using :

Ubuntu 16.04.3 LTS
4.10.0-42-generic #46~16.04.1-Ubuntu SMP x86_64
indicator-cpufreq 0.2.2-0ubuntu2 all

when launching indicator-cpufreq from terminal, following warnings are displayed :

/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:20: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:21: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator

to get rid of them, i had to apply the warning suggestions by editing /usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py
and change :

from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import AppIndicator3 as appindicator

to

from gi.repository import GLib
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as appindicator

does it exist a cleaner or more generic way of fixing this warning ? if not, why this one is not released ?

regards,

Matthieu

Revision history for this message
Roger Lawhorn (rll-m) wrote :

I get this error randomly.
I have no idea what causes it.
Python update?
Kernel update?
Its seems random.

Revision history for this message
Roger Lawhorn (rll-m) wrote :

note: with no sign of a fix for this bug in sight I am adding the following lines to my .profile file in my home folder to force a particular frequency and governor after a shell login:

sudo cpufreq-set -g performance
sudo cpufreq-set -f 3300000

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.