在Anaconda的Jupyter Notebook安装chromadb遇onnxruntime版本兼容问题求助
解决Mac上chromadb安装因onnxruntime版本限制的问题
问题场景
- 在Anaconda环境的Jupyter Notebook中执行
pip install chromadb时出现报错:
ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.14.1 (from chromadb) (from versions: 1.2.0, 1.3.0, 1.4.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.11.0, 1.11.1)
ERROR: No matching distribution found for onnxruntime>=1.14.1 (from chromadb)
- 手动执行
pip install onnxruntime仅能成功安装1.11.1版本,推测Mac系统最高兼容该版本,导致无法满足chromadb的依赖要求。
可行解决方案
安装兼容低版本onnxruntime的chromadb旧版本
chromadb早期版本对onnxruntime的要求更低,可指定安装适配1.11.1的版本,例如0.3.26:pip install chromadb==0.3.26该版本依赖要求中onnxruntime最低版本为1.10.0,完全适配已安装的1.11.1。
强制安装chromadb并忽略依赖(谨慎使用)
若需使用最新版chromadb,可尝试绕过依赖冲突强制安装,但部分依赖onnxruntime的功能(如特定嵌入模型)会无法正常工作:pip install chromadb --no-deps安装后需手动补充除onnxruntime外的其他必要依赖。
升级系统或更换Python环境
若Mac系统版本较旧,升级至最新macOS通常可支持更高版本的onnxruntime;也可创建Python 3.10及以上版本的conda环境尝试安装:conda create -n chroma_env python=3.10 conda activate chroma_env pip install chromadb
内容的提问来源于stack exchange,提问作者Victor
相关产品推荐
相关产品推荐

