Open Shrimpchu opened 3 months ago
在v0.3.2尝试修复了htmlrenderer的导入方式,请再次尝试
仍然无法加载,报错如下:
`08-07 11:45:31 [ERROR] nonebot | Failed to import "nonebot_plugin_htmlrender"
Traceback (most recent call last):
File "
File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 167, in load_plugin module = importlib.import_module(self._third_party_plugin_ids[name]) File "C:\Program Files\Python312\Lib\importlib__init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "
", line 1381, in _gcd_import File " pydantic_validator.validate_python( pydantic_core._pydantic_core.ValidationError: 3 validation errors for Config htmlrender_download_host Field required [type=missing, input_value={'driver': '~fastapi', 'h....timedelta(seconds=120)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.8/v/missing htmlrender_proxy_host Field required [type=missing, input_value={'driver': '~fastapi', 'h....timedelta(seconds=120)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.8/v/missing htmlrender_browser_channel Field required [type=missing, input_value={'driver': '~fastapi', 'h....timedelta(seconds=120)}, input_type=dict] For further information visit https://errors.pydantic.dev/2.8/v/missing 08-07 11:45:31 [ERROR] nonebot | Failed to import "nonebot_plugin_bfchat" Traceback (most recent call last): File "", line 1354, in _find_and_load File " ", line 1325, in _find_and_load_unlocked File " ", line 929, in _load_unlocked File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 255, in exec_module super().exec_module(module) File " ", line 994, in exec_module File " ", line 488, in _call_with_frames_removed File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot_plugin_htmlrender__init__.py", line 4, in from .browser import get_browser, get_new_page, shutdown_browser File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot_plugin_htmlrender\browser.py", line 27, in config = Config.parse_obj(get_driver().config.dict()) File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\pydantic\main.py", line 1135, in parse_obj return cls.model_validate(obj) File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\pydantic\main.py", line 568, in model_validate return cls. ", line 12, in init__.py", line 14, inFile "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\load.py", line 131, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\load.py", line 65, in load_all_plugins return manager.load_all_plugins() File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 203, in load_all_plugins return set( File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 204, in filter(None, (self.load_plugin(name) for name in self.available_plugins)) File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 167, in load_plugin module = importlib.import_module(self._third_party_plugin_ids[name]) File "C:\Program Files\Python312\Lib\importlib__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) File " ", line 1381, in _gcd_import File " ", line 1354, in _find_and_load File " ", line 1325, in _find_and_load_unlocked File " ", line 929, in _load_unlocked File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\manager.py", line 255, in exec_module super().exec_module(module) File " ", line 994, in exec_module File " ", line 488, in _call_with_frames_removed File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot_plugin_bfchat\ require("nonebot_plugin_htmlrender") File "C:\Users\Administrator\botKotone.venv\Lib\site-packages\nonebot\plugin\load.py", line 188, in require raise RuntimeError(f'Cannot load plugin "{name}"!') RuntimeError: Cannot load plugin "nonebot_plugin_htmlrender"!`
不,我确定我使用的是python 3.12
能否在pip list
中找到nonebot_plugin_htmlrender?
如果没有,尝试单独安装。
如果有,很遗憾我这里无法复现,烦请您移步 nonebot_plugin_htmlrender 发起一个新issue并引用此issue。
经过检查,发现问题由nonebot_plugin_htmlrender插件使用了pydantic v2版本,形成了较大改动导致。
现在推送v0.4.0
版本,将依赖更新至最新版本,修复了导入问题。
不论是nonebot商店测试结果还是我个人尝试加载都出现了如下错误: 05-07 08:56:09 [ERROR] nonebot | Failed to import "nonebot_plugin_bfchat" Traceback (most recent call last): File "/home/runner/work/registry/registry/plugin_test/nonebot-plugin-bfchat-nonebot_plugin_bfchat-test/runner.py", line 16, in
plugin = load_plugin("nonebot_plugin_bfchat")
File "/home/runner/work/registry/registry/plugin_test/nonebot-plugin-bfchat-nonebot_plugin_bfchat-test/.venv/lib/python3.10/site-packages/nonebot/plugin/load.py", line 40, in load_plugin
return manager.load_plugin(module_path)