[Bug] 安装或重载插件后,插件仓库的requirements.txt不会下载安装
What happened / 发生了什么
当安装或重载一些插件时,插件仓库下的requirements.txt包含的库不会自动安装,导致有一些插件(如self-learning)出现错误,这似乎不是预期行为
Reproduce / 如何复现?
安装插件即可复现
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
v4.18.3,docker部署
OS
Linux
Logs / 报错日志
以下是插件Iris Memory 智能三层记忆的缺少运行库的报错日志: [02:11:35.556] [Core] [INFO] [star.star_manager:634]: Plugin astrbot_plugin_iris_memory (v1.10.2) by Leafiber: 为 AstrBot 提供全功能记忆增强,内置主动回复、知识图谱、向量数据库、用户画像、Web管理等功能,支持人格隔离、astrbot错误拦截、图片分析、Markdown格式去除等实用功能。[02:11:37.847] [Plug] [INFO] [utils.logger:81]: [memory_service] [memory_service.py:288] IrisMemory plugin initializing...[02:11:37.849] [Plug] [INFO] [utils.logger:81]: [service_initializer] [initializer.py:107] IrisMemory plugin initializing...[02:11:38.046] [Plug] [ERRO] [v4.18.3] [utils.logger:77]: [chroma_manager] [chroma_manager.py:118] Failed to initialize Chroma manager: chromadb is not installed. Please install it with: pip install chromadb[02:11:38.049] [Plug] [ERRO] [v4.18.3] [utils.logger:77]: [service_initializer] [initializer.py:132] IrisMemory plugin initialization failed: chromadb is not installed. Please install it with: pip install chromadb[02:11:38.052] [Plug] [ERRO] [v4.18.3] [utils.logger:77]: [memory_service] [memory_service.py:307] IrisMemory plugin initialization failed: chromadb is not installed. Please install it with: pip install chromadb[02:11:38.055] [Core] [ERRO] [v4.18.3] [star.star_manager:834]: ----- 插件 astrbot_plugin_iris_memory 载入失败 -----[02:11:38.060] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | Traceback (most recent call last):[02:11:38.060] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/astrbot/core/star/star_manager.py", line 818, in load[02:11:38.061] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await metadata.star_cls.initialize()[02:11:38.061] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/main.py", line 77, in initialize[02:11:38.062] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await self._service.initialize()[02:11:38.062] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/services/memory_service.py", line 290, in initialize[02:11:38.063] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | result = await self._initializer.initialize_all()[02:11:38.063] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[02:11:38.064] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/services/initializer.py", line 109, in initialize_all[02:11:38.064] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await self._init_phase_core()[02:11:38.065] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/services/initializer.py", line 143, in _init_phase_core[02:11:38.065] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await self._init_core_components()[02:11:38.066] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/services/initializer.py", line 250, in _init_core_components[02:11:38.066] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await self._deps.storage.initialize([02:11:38.067] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/services/modules/storage_module.py", line 76, in initialize[02:11:38.067] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await self._chroma_manager.initialize()[02:11:38.068] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/storage/chroma_manager.py", line 115, in initialize[02:11:38.068] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | await initializer.initialize()[02:11:38.069] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | File "/AstrBot/data/plugins/astrbot_plugin_iris_memory/iris_memory/storage/chroma_init.py", line 48, in initialize[02:11:38.070] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | raise ImportError([02:11:38.071] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | ImportError: chromadb is not installed. Please install it with: pip install chromadb[02:11:38.072] [Core] [ERRO] [v4.18.3] [star.star_manager:837]: | [02:11:38.072] [Core] [ERRO] [v4.18.3] [star.star_manager:838]: ----------------------------------[02:11:38.073] [Core] [INFO] [star.star_manager:846]: 失败插件依旧在插件列表中,正在清理...[02:11:38.160] [Core] [WARN] [v4.18.3] [star.star_manager:889]: 已清理安装失败的插件目录: /AstrBot/data/plugins/astrbot_plugin_iris_memory[02:11:38.160] [Core] [WARN] [v4.18.3] [star.star_manager:902]: 已清理安装失败插件配置: /AstrBot/data/config/astrbot_plugin_iris_memory_config.json[02:11:38.164] [Core] [ERRO] [v4.18.3] [routes.plugin:499]: Traceback (most recent call last): File "/AstrBot/astrbot/dashboard/routes/plugin.py", line 481, in install_plugin plugin_info = await self.plugin_manager.install_plugin( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/star/star_manager.py", line 949, in install_plugin raise Exception( Exception: 加载 astrbot_plugin_iris_memory 插件时出现问题,原因 chromadb is not installed. Please install it with: pip install chromadb。
Are you willing to submit a PR? / 你愿意提交 PR 吗?
- [x] Yes!
Code of Conduct
- [x] I have read and agree to abide by the project's Code of Conduct。
看了一下应该是这一段代码将仓库下载包给跳过了,看着像是检查是否依赖通过,不通过就下包。不过似乎有一些库引用是不能通过这个import函数检查出来的
另外插件间依赖好像没有环境隔离,会存在互相影响的情况