在win11报ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based

一、问题

在win11使用langchain,安装向量数据库(pip install Chroma)时报错:ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects,提示去微软安装C++依赖,打开网页后,会让下载【Visual Studio Installer】。。。
在win11报ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based_第1张图片
在win11报ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based_第2张图片

二、解决方案

1.安装依赖

报错时,看是报了缺失C++依赖的错误,只点击【单个组件】去安装C++组件,安装后,还是无法成功安装Chroma!

如果内存充足,直接点击【使用C++的桌面开发】安装上相关的C++依赖,安装后,再安装Chroma即可。如果内存不够,那就手动勾选右侧的组件,通过一个个安装的方式进行排除(这一步我没试,因为费时间!)
在win11报ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based_第3张图片

2.安装Chroma

安装了【使用C++的桌面开发】菜单中的组件后,如下图,可以成功安装Chroma。

pip install Chroma

在win11报ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based_第4张图片

你可能感兴趣的:(langchain,常见错误记录,python)