STESmly / nonebot_plugin_bililivedm

基于ws的b站弹幕监控
1 stars 0 forks source link

[求助]尝试在Linux系统上使用示例代码时报错 #1

Open Wfgukasha opened 3 weeks ago

Wfgukasha commented 3 weeks ago

环境信息

centos 9,python3.12.5

报错内容

Exception in thread Thread-2 (run_app):
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/unix_events.py", line 105, in add_signal_handler
    signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread of the main interpreter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "/root/wf-bot/wf_bot/plugins/__init__.py", line 26, in run_app
    web.run_app(app, host="127.0.0.1", port=13579,print=None)
  File "/root/wf-bot/.venv/lib/python3.12/site-packages/aiohttp/web.py", line 526, in run_app
    loop.run_until_complete(main_task)
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
RuntimeError: set_wakeup_fd only works in main thread of the main interpreter

很神奇,在windows上又能正常运行

STESmly commented 3 weeks ago

可能是linux系统在线程,信号,这方面的处理与win系统有差别吧,我没linux的电脑,所以暂时没办法修正

STESmly commented 3 weeks ago

因为我这个在写的时候run起来会卡nb主线程,所以我是通过单独开线程来让这个插件跑的

Wfgukasha commented 3 weeks ago

可能是linux系统在线程,信号,这方面的处理与win系统有差别吧,我没linux的电脑,所以暂时没办法修正

这样啊...