`05-11 13:12:39 [ERROR] nonebot | Failed to import "hikari_bot"
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\test\first\bot.py", line 18, in
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\load.py", line 125, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\load.py", line 62, in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 175, in load_all_plugins
return set(
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 176, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib__init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 240, in exec_module
super().exec_module(module)
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\hikari_bot\init__.py", line 29, in
from .command_select import select_command
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\hikari_bot\command_select.py", line 4, in
from .game.ban_search import get_BanInfo
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\hikari_bot\game\ban_search.py", line 13, in
from ..HttpClient_pool import client_yuyuko
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\hikari_bot\HttpClient_pool.py", line 31, in
http2 = config.http2
AttributeError: 'Config' object has no attribute 'http2'`
更到0.3.9.1之后无法启动插件,Python版本是3.11 代码如下
`05-11 13:12:39 [ERROR] nonebot | Failed to import "hikari_bot" Traceback (most recent call last): File "C:\Users\Administrator\Desktop\test\first\bot.py", line 18, in
nonebot.load_from_toml("pyproject.toml")
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\load.py", line 125, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\load.py", line 62, in load_all_plugins
return manager.load_all_plugins()
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 175, in load_all_plugins
return set(
File "C:\Users\Administrator\Desktop\test\first.venv\Lib\site-packages\nonebot\plugin\manager.py", line 176, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
在将这个路径
C:\Users\Administrator\Desktop\test\first\.venv\Lib\site-packages\hikari_bot\HttpClient_pool.py
下的http2 = config.http2
改为http2 = getattr(config, 'http2', None)
之后可以载入了