lgc-NB2Dev/nonebot-plugin-picstatus

运行时出错 No such file or directory (originated from sysctl(HW_CPU_FREQ)

F1Justin opened this issue · 2 comments

系统 macOS 14.0
CPU Apple M2 Pro

详细错误代码

07-31 09:14:41 [SUCCESS] nonebot | OneBot V11 985393579 | [message.group.normal]: Message 17807058 from 2843657817@[群:1080353942] '/zt'
07-31 09:14:41 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_picstatus.__main__)
07-31 09:14:41 [ERROR] nonebot_plugin_picstatus | 获取运行状态图失败
Traceback (most recent call last):
  File "/Users/justin/lily/.venv/lib/python3.9/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
> File "/Users/justin/lily/.venv/lib/python3.9/site-packages/nonebot_plugin_picstatus/__main__.py", line 119, in _
    ret = await get_stat_pic(bot, pic)
  File "/Users/justin/lily/.venv/lib/python3.9/site-packages/nonebot_plugin_picstatus/draw.py", line 462, in get_stat_pic
    ) = await asyncio.gather(
  File "/Users/justin/lily/.venv/lib/python3.9/site-packages/nonebot_plugin_picstatus/status.py", line 147, in get_cpu_memory_usage
    cpu_freq = psutil.cpu_freq()
  File "/Users/justin/lily/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 1869, in cpu_freq
    ret = _psplatform.cpu_freq()
  File "/Users/justin/lily/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 179, in cpu_freq
    curr, min_, max_ = cext.cpu_freq()
FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ))
07-31 09:14:41 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_picstatus.__main__) running complete
DDG667 commented

请尝试是否有效

#psutil1892

干脆改了一下代码不检查cpu频率了,现在图片能发出来了