我的Python3脚本使用psutil
v5.6.2提取有关当前系统的各种信息(Ubuntu18.04,AMD 2700X),例如CPU核心温度。
问题:但是,运行以下代码以获得核心温度
import psutil
psutil.sensors_temperatures()
返回一个空的数据集
{}
即使运行lmsensors
(传感器3.4.0版本和libsensors版本3.4.0,Ubuntu18.04)确实返回温度
$ sensors
nouveau-pci-1f00
Adapter: PCI adapter
GPU core: +0.91 V (min = +0.80 V, max = +1.19 V)
temp1: +36.0°C (high = +95.0°C, hyst = +3.0°C)
(crit = +105.0°C, hyst = +5.0°C)
(emerg = +135.0°C, hyst = +5.0°C)
k10temp-pci-00c3
Adapter: PCI adapter
Tdie: +79.4°C (high = +70.0°C)
Tctl: +89.4°C
为什么psutil
不给我们我们所需要的温度,我们如何解决这个问题?
PS:也研究了https://bitbucket.org/blackjack/pysensors/src,但它不支持Python3。有关于Python3的建议吗?
发布于 2020-03-03 14:50:34
到目前为止,Pysensors确实支持python3。
https://stackoverflow.com/questions/56721172
复制相似问题