Glances 运行报错:RuntimeWarning: ignoring OSError(61, ‘No data available‘)

运行glances时报如下错误:

/usr/lib/python3/dist-packages/psutil/_pslinux.py:1150: RuntimeWarning: ignoring OSError(61, '没有可用的数据')
  warnings.warn("ignoring %r" % err, RuntimeWarning)

报此错误时运行如下命令也报错

$ python3
> import psutil
> psutil.sensors_temperatures()
> psutil.sensors_fans()
> psutil.sensors_battery()

运行结果如下 

Python 3.6.9 (default, Jun 29 2022, 11:45:57) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.sensors_temperatures()
/usr/lib/python3/dist-packages/psutil/_pslinux.py:1150: RuntimeWarning: ignoring OSError(61, 'No data available')
  warnings.warn("ignoring %r" % err, RuntimeWarning)
{'acpitz': [shwtemp(label='', current=16.8, high=20.8, critical=20.8), shwtemp(label='', current=16.8, high=20.8, critical=20.8), shwtemp(label='', current=27.8, high=119.0, critical=119.0)], 'pch_cometlake': [shwtemp(label='', current=30.0, high=None, critical=None)], 'coretemp': [shwtemp(label='Package id 0', current=25.0, high=82.0, critical=100.0), shwtemp(label='Core 8', current=24.0, high=82.0, critical=100.0), shwtemp(label='Core 9', current=23.0, high=82.0, critical=100.0), shwtemp(label='Core 0', current=22.0, high=82.0, critical=100.0), shwtemp(label='Core 1', current=24.0, high=82.0, critical=100.0), shwtemp(label='Core 2', current=23.0, high=82.0, critical=100.0), shwtemp(label='Core 3', current=23.0, high=82.0, critical=100.0), shwtemp(label='Core 4', current=22.0, high=82.0, critical=100.0), shwtemp(label='Core 5', current=22.0, high=82.0, critical=100.0), shwtemp(label='Core 6', current=22.0, high=82.0, critical=100.0), shwtemp(label='Core 7', current=24.0, high=82.0, critical=100.0)], 'nouveau': [shwtemp(label='', current=35.0, high=95.0, critical=105.0)]}
>>> psutil.sensors_fans()
{'nouveau': [sfan(label='', current=2294)]}
>>> psutil.sensors_battery()
>>> exit()

请执行命令更新:

 sudo pip3 install --upgrade psutil

问题解决。 

参考官方bug问题列表:

Glances is not showing sensors information. · Issue #1087 · nicolargo/glances · GitHub

https://github.com/giampaolo/psutil/issues/1009

https://github.com/giampaolo/psutil/issues/1129

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值