ubuntu 在安装AI GPT RAG 文档代码过程中出现了,下面的错误
Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0
通过命令查看版本
sqlite3 --version
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1
提示sqlite3 版本过低 ,需要升级sqlite3 .
查询官方文档 https://docs.trychroma.com/troubleshooting#sqlite
https://gist.github.com/defulmere/8b9695e415a44271061cc8e272f3c300
解决方案如下 :
1. 安装 pip install pysqlite3-binary 二进制扩展
运行命令
pip install pysqlite3-binary
2. 在python chromadb 扩展中 __init__.py 怎加部分代码
(1) 找到目前扩展 chromadb 位置
直接运行 python 回车 ,然后运行
>>> import sys
>>> print(os.path.dirname(sys.executable))
结果会是 你当前 python 的路径地址
/opt/DeepBI_flipos_api/venv/bin
扩展路径则是 /opt/DeepBI_flipos_api/venv
(2) 找到 venv/lib/python3.10/site-packages/chromadb 直接编辑 __init__.py 在最开始位置增加
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
保存,然后重启服务即可。
http://%77%77%77%2E%66网站制作%6F学习网%72%61%73%70%2E%63%6E