mnixry / nonebot-plugin-gocqhttp

一款在NoneBot2中直接运行go-cqhttp的插件, 无需额外下载安装 / A plugin to run go-cqhttp directly in NoneBot2, without additional download and installation.
https://pypi.org/project/nonebot-plugin-gocqhttp/
GNU Affero General Public License v3.0
321 stars 25 forks source link

Failed to import "nonebot_plugin_gocqhttp" #512

Closed CheatManager closed 1 year ago

CheatManager commented 1 year ago
03-02 23:51:10 [ERROR] nonebot | Failed to import "nonebot_plugin_gocqhttp"
Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
    return load_all_plugins(plugins, plugin_dirs)
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins    return manager.load_all_plugins()
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
    return set(
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in <genexpr>
    filter(None, (self.load_plugin(name) for name in self.available_plugins))
> File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
    module = importlib.import_module(name)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
    super().exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/root/first/.venv/lib/python3.10/site-packages/nonebot_plugin_gocqhttp/__init__.py", line 24, in <module>

python版本 3.10.10 pip 版本 23.0.1 其他插件加载无错误

mnixry commented 1 year ago

报错内容不完整, 请提供完整日志

CheatManager commented 1 year ago

报错内容不完整, 请提供完整日志

[root@ihan first]# nb run Using virtual environment: /root/first/.venv/bin/python 03-03 00:03:49 [SUCCESS] nonebot | NoneBot is initializing... 03-03 00:03:49 [INFO] nonebot | Current Env: prod 03-03 00:03:51 [ERROR] nonebot | Failed to import "nonebot_plugin_gocqhttp" Traceback (most recent call last): File "", line 8, in File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins return manager.load_all_plugins() File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins return set( File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 169, in filter(None, (self.load_plugin(name) for name in self.available_plugins)) File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin module = importlib.import_module(name) File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/root/first/.venv/lib/python3.10/site-packages/nonebot/plugin/manager.py", line 233, in exec_module super().exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/root/first/.venv/lib/python3.10/site-packages/nonebot_plugin_gocqhttp/init.py", line 24, in raise ValueError(f"Adapter {adapter_name!r} is not registered yet.") ValueError: Adapter 'OneBot V11' is not registered yet. 03-03 00:03:51 [SUCCESS] nonebot | Running NoneBot... 03-03 00:03:51 [INFO] uvicorn | Started server process [29348] 03-03 00:03:51 [INFO] uvicorn | Waiting for application startup. 03-03 00:03:51 [INFO] uvicorn | Application startup complete. 03-03 00:03:51 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)

mnixry commented 1 year ago

Duplicate of #319