-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Plugin Version
2.0.6
AstrBot Version
AstrBot v4.19.4
Database Type
SQLite (default)
Operating System
macOS
Bug Description
插件目录内打包了大量第三方依赖(包括含 .so 二进制的包),在 macOS ARM(Apple Silicon)环境下与系统全局依赖冲突,导致其他插件的子进程启动时崩溃。
报错信息:
ModuleNotFoundError: No module named 'jiter.jiter'
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
ModuleNotFoundError: No module named 'rpds.rpds'
根本原因:插件目录内的 jiter/、pydantic/、pydantic_core/、rpds/ 等包含的二进制文件是 Linux x86 环境下编译的,无法在 macOS ARM 上加载。由于 AstrBot 会将所有插件目录加入 sys.path,当其他插件开启子进程时,Python 优先找到了插件目录内的残缺版本,导致进程池崩溃。
建议修复:将所有第三方依赖加入 .gitignore,改用 requirements.txt 声明依赖,由用户环境自行安装适配本地平台的版本。
Steps to Reproduce
- 在 macOS ARM (Apple Silicon) 上安装插件
- 启动 AstrBot
- 触发任何需要子进程的插件功能(如 astrbot_plugin_help_typst 的 /helps 命令)
- 子进程因加载插件目录内残缺的二进制包而崩溃
Expected Behavior
插件正常加载,不影响其他插件的子进程运行
Error Logs
ModuleNotFoundError: No module named 'jiter.jiter'
File "/Users/.../data/plugins/astrbot_plugin_self_learning/jiter/__init__.py"
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
File "/Users/.../data/plugins/astrbot_plugin_self_learning/pydantic_core/__init__.py"
ModuleNotFoundError: No module named 'rpds.rpds'
File "/Users/.../data/plugins/astrbot_plugin_self_learning/rpds/__init__.py"
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.Relevant Configuration
Additional Context
临时修复方法:手动删除插件目录内的以下文件夹即可恢复正常:
jiter/、jiter-0.13.0.dist-info/
pydantic/、pydantic_core/
rpds/、rpds_py-0.30.0.dist-info/
以及其他所有打包进插件目录的第三方库文件夹。
根本修复建议:在 .gitignore 中排除所有第三方依赖目录,改用 requirements.txt 管理依赖。