参考这个文章解决了问题:ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects
以下是我安装的时候,报错:
Building wheel for hnswlib (pyproject.toml) ... errorerror: subprocess-exited-with-error× Building wheel for hnswlib (pyproject.toml) did not run successfully.│ exit code: 1╰─> [5 lines of output]running bdist_wheelrunning buildrunning build_extbuilding 'hnswlib' extensionerror: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects
-
首先我在这个网址进行了文件的下载:https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/
-
下载完成之后,鼠标选中,右键,以管理员身份运行
-
打开的软件,选择这两个地方:
-
全部安装完毕,再重新尝试以下命令进行安装:
pip install hnswlib