HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.39k stars 602 forks source link

将nonebot-plugin-htmlrender文件夹放入plugins文件夹后无法启动bot.py #502

Closed SpideyUU closed 2 years ago

SpideyUU commented 2 years ago

日志如下 OS: Windows 11 21H2 22000.675 Python 版本: 3.9.7 真寻版本:0.1.5.3

Task exception was never retrieved future: <Task finished name='Task-301' coro=<Connection.run() done, defined at C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_connection.py:174> exception=NotImplementedError()> Traceback (most recent call last): File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_connection.py", line 181, in run await self._transport.connect() File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_transport.py", line 136, in connect raise exc File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_transport.py", line 124, in connect self._proc = await asyncio.create_subprocess_exec( File "D:\ProgramData\Anaconda3\lib\asyncio\subprocess.py", line 236, in create_subprocess_exec transport, protocol = await loop.subprocess_exec( File "D:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 1661, in subprocess_exec transport = await self._make_subprocess_transport( File "D:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 493, in _make_subprocess_transport raise NotImplementedError NotImplementedError 05-21 19:36:13 [ERROR] uvicorn | Traceback (most recent call last): File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\starlette\routing.py", line 621, in lifespan async with self.lifespan_context(app): File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\starlette\routing.py", line 518, in aenter await self._router.startup() File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\starlette\routing.py", line 598, in startup await handler() File "E:\QQ_bot\zhenxun_bot-0.1.5.3\zhenxun_bot-0.1.5.3\new_plugins\nonebot_plugin_htmlrender__init__.py", line 27, in init browser = await get_browser(kwargs) File "E:\QQ_bot\zhenxun_bot-0.1.5.3\zhenxun_bot-0.1.5.3\new_plugins\nonebot_plugin_htmlrender\browser.py", line 40, in get_browser return _browser or await init(kwargs) File "E:\QQ_bot\zhenxun_bot-0.1.5.3\zhenxun_bot-0.1.5.3\new_plugins\nonebot_plugin_htmlrender\browser.py", line 26, in init _playwright = await async_playwright().start() File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright\async_api_context_manager.py", line 51, in start return await self.aenter() File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright\async_api_context_manager.py", line 46, in aenter playwright = AsyncPlaywright(next(iter(done)).result()) File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_connection.py", line 181, in run await self._transport.connect() File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_transport.py", line 136, in connect raise exc File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\playwright_impl_transport.py", line 124, in connect self._proc = await asyncio.create_subprocess_exec( File "D:\ProgramData\Anaconda3\lib\asyncio\subprocess.py", line 236, in create_subprocess_exec transport, protocol = await loop.subprocess_exec( File "D:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 1661, in subprocess_exec transport = await self._make_subprocess_transport( File "D:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 493, in _make_subprocess_transport raise NotImplementedError NotImplementedError

05-21 19:36:13 [ERROR] uvicorn | Application startup failed. Exiting. Error in atexit._run_exitfuncs: Traceback (most recent call last): File "C:\Users\wushe\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-g0yw_oi1-py3.9\lib\site-packages\bilibili_api\utils\network.py", line 26, in __clean loop = asyncio.get_event_loop() File "D:\ProgramData\Anaconda3\lib\asyncio\events.py", line 642, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'MainThread'.

直接将该标红文件夹放入plugins或者自建new_plugins(已在bot.py里添加代码)文件夹,都会导致bot启动失败产生上述日志。 image

HibiKier commented 2 years ago

重新clone代码,删除虚拟环境重新poetry install

yixue99 commented 2 years ago

重新clone代码,删除虚拟环境重新poetry install

Windows现在支持playwright了?

WWWA7 commented 2 years ago

重新clone代码,删除虚拟环境重新poetry install

Windows现在支持playwright了?

好像还不行,现在还是和playwright有关的插件都不能用

HibiKier commented 2 years ago

重新clone代码,删除虚拟环境重新poetry install

Windows现在支持playwright了?

好像还不行,现在还是和playwright有关的插件都不能用

之前依赖了bilibili-api,现在已经换了,我本地win测试可以使用playwright

HibiKier commented 2 years ago

破案了,除了Bilibili-api,check_zhenxun_update插件中 图片 这一段代码导致playwright无法运行

HibiKier commented 2 years ago

暂时已修复