Search code examples
pythoncpu-usagecpu-speedpsutil

Python3 psutils


does anyone have an idea why psutil's cpu_freq() returns empty? I'm running python 3.4 on Debian linux 8.7.1. I've tried with and without elevated rights and gotten the same result.

Python 3.4.2 (default, Oct  8 2014, 10:45:20) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.cpu_freq()
[]
>>> 

Other CPU information (such as cpu_stats() is returned correctly. Thanks a lot!


Solution

  • This is a bug in psutil, see issue #981 in the psutil project issue tracker.

    The location of the CPU frequency information has moved in recent kernels, from /sys/devices/system/cpu/cpufreq/platform* directories, to /sys/devices/system/cpu/cpu*/cpufreq directories, and the project has not yet followed suit.

    The new 5.2.1 release includes the fix for this.