. 解决方案
使用 pysqlite3-binary
覆盖默认模块
这是最简单的解决方案,无需重新编译 Python 或修改系统环境。
-
安装
pysqlite3-binary
:pip install pysqlite3-binary
-
修改
open-webui
的启动脚本:-
找到
open-webui
的入口脚本(通常是/usr/local/bin/open-webui
或/path/to/open-webui/venv/bin/open-webui
),找不到就搜索open-webui
-
在脚本的开头添加以下代码:
__import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
-
-
重新运行
open-webui serve
:open-webui serve