Ailitonia / omega-miya

基于 nonebot2 的多平台机器人
MIT License
272 stars 50 forks source link

tortoise已经安装了No module named 'tortoise.models' #83

Closed Bearlele closed 2 years ago

Bearlele commented 2 years ago

tortoise已经安装了启动依然提示 Failed to import "bilibili_dynamic_monitor" No module named 'tortoise.models'

Ailitonia commented 2 years ago

请提供完整的异常日志,tortoise 应该是上游依赖,我不清楚和b站动态插件有什么联系

Bearlele commented 2 years ago

04-17 23:13:52 [ERROR] nonebot | Failed to import "bilibili_live_monitor" Traceback (most recent call last): File "/root/nonebot/bot.py", line 31, in nonebot.load_from_toml("pyproject.toml") File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/load.py", line 119, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/load.py", line 53, in load_all_plugins return manager.load_all_plugins() File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/manager.py", line 128, in load_all_plugins return set( File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/manager.py", line 129, in filter(None, (self.load_plugin(name) for name in self.list_plugins()))

File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/manager.py", line 106, in load_plugin module = importlib.import_module( File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "/usr/local/lib/python3.9/dist-packages/nonebot/plugin/manager.py", line 194, in exec_module super().exec_module(module) File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/root/nonebot/omega_miya/plugins/bilibili_live_monitor/init.py", line 8, in from omega_miya.database import DBBot, DBBotGroup, DBFriend, DBSubscription, Result File "/root/nonebot/omega_miya/database/init.py", line 1, in from .db import DB File "/root/nonebot/omega_miya/database/db.py", line 5, in from omega_miya.database import models File "/root/nonebot/omega_miya/database/models.py", line 5, in from tortoise.models import Model ModuleNotFoundError: No module named 'tortoise.models'

Ailitonia commented 2 years ago

你真的是从这个仓库下载的源码吗??? 这文件结构都不一样了,而且我 orm 用的是 sqlalchemy 而不是 tortoise 啊???

Bearlele commented 2 years ago

我是单独把omega_miya整个插件目录单独拷贝出来用了0.0

Ailitonia commented 2 years ago

抱歉,我不清楚你做了什么样的调整,这个项目应该没有涉及 tortoise 的部分😂

Bearlele commented 2 years ago

好叭 我再仔细研究一下 谢谢啦