MinatoAquaCrews / nonebot_plugin_what2eat

What2eat & what2drink plugin for nonebot2
MIT License
59 stars 9 forks source link

AttributeError: 'Config' object has no attribute 'groups_id' #35

Closed Anselyuki closed 1 year ago

Anselyuki commented 1 year ago

当我在一个全新的环境中启动(python3.11),插件加载错误(其余几个插件均正常),具体报错日志如下

05-08 04:34:15 [ERROR] nonebot | Failed to import "nonebot_plugin_what2eat"
Traceback (most recent call last):
  File "/root/Ansel-Bot/bot.py", line 25, in <module>
    nonebot.load_plugin('nonebot_plugin_what2eat')
  File "/root/mambaforge/envs/nonebot/lib/python3.11/site-packages/nonebot/plugin/load.py", line 37, in load_plugin
    return manager.load_plugin(module_path)
> File "/root/mambaforge/envs/nonebot/lib/python3.11/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
    module = importlib.import_module(name)
  File "/root/mambaforge/envs/nonebot/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/root/mambaforge/envs/nonebot/lib/python3.11/site-packages/nonebot/plugin/manager.py", line 240, in exec_module
    super().exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/root/mambaforge/envs/nonebot/lib/python3.11/site-packages/nonebot_plugin_what2eat/__init__.py", line 6, in <module>
    from .utils import eating_manager, Meals, GROUPS_ID
  File "/root/mambaforge/envs/nonebot/lib/python3.11/site-packages/nonebot_plugin_what2eat/utils.py", line 24, in <module>
    _GROUPS_ID = nonebot.get_driver().config.groups_id
AttributeError: 'Config' object has no attribute 'groups_id'
KafCoppelia commented 1 year ago

这是用的什么版本的what2eat插件?

Anselyuki commented 1 year ago

跟nonebot相关的版本与what2eat插件版本如下

nonebot-adapter-onebot       2.2.3
nonebot-plugin-apscheduler   0.2.0
nonebot-plugin-guild-patch   0.2.3
nonebot-plugin-htmlrender    0.2.0.3
nonebot-plugin-reboot        0.1.3
nonebot-plugin-what2eat      0.2.2
nonebot2                     2.0.0rc4
noneprompt                   0.1.9
Anselyuki commented 1 year ago

我从pip安装,默认安装的0.2.2,现在手动强制安装0.3.6之后可以正常使用了,感谢提醒