我正在尝试在Mac上安装embeddinghub(尝试了pip3 install embeddinghub和pip3 install pandas embeddinghub protobuf),但是我得到了同样的错误,说“无法为hnswlib构建轮子,这是安装基于pyproject.toml的项目所需的”。 我找不到任何关于hnswlib的解决方案。 我已经尝试了很多关于PEP517和为其他事物构建轮子的解决方案,但是没有一个解决方案能够帮助我。 这是完整的错误:
错误
错误
Collecting pandas
Using cached pandas-1.5.0-cp310-cp310-macosx_11_0_arm64.whl (10.8 MB)
Collecting embeddinghub
Using cached embeddinghub-0.0.1.post12-py3-none-any.whl
Collecting protobuf
Using cached protobuf-4.21.7-cp37-abi3-macosx_10_9_universal2.whl (484 kB)
Collecting pytz>=2020.1
Using cached pytz-2022.4-py2.py3-none-any.whl (500 kB)
Collecting python-dateutil>=2.8.1
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting numpy>=1.21.0
Using cached numpy-1.23.3-cp310-cp310-macosx_11_0_arm64.whl (13.3 MB)
Collecting grpcio==1.40.0
Using cached grpcio-1.40.0-cp310-cp310-macosx_10_10_universal2.whl
Collecting hnswlib==0.5.2
Using cached hnswlib-0.5.2.tar.gz (29 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.21.0
Using cached numpy-1.21.1-cp310-cp310-macosx_12_0_universal2.whl
Collecting six==1.16.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: hnswlib
Building wheel for hnswlib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for hnswlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
running bdist_wheel
running build
running build_ext
creating var
creating var/folders
creating var/folders/3h
creating var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn
creating var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/s/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/tmp5hthbs8k.cpp -o var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/tmp5hthbs8k.o -std=c++14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/s/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/tmpipibvgip.cpp -o var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/tmpipibvgip.o -fvisibility=hidden
building 'hnswlib' extension
creating build
creating build/temp.macosx-10.9-universal2-cpython-310
creating build/temp.macosx-10.9-universal2-cpython-310/python_bindings
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/private/var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/pip-build-env-hhht57g1/overlay/lib/python3.10/site-packages/pybind11/include -I/private/var/folders/3h/0w98c6q56bl4x4c2qm31np_c0000gn/T/pip-build-env-hhht57g1/overlay/lib/python3.10/site-packages/numpy/core/include -I./hnswlib/ -I/Users/s/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c ./python_bindings/bindings.cpp -o build/temp.macosx-10.9-universal2-cpython-310/./python_bindings/bindings.o -O3 -march=native -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO=\"0.5.2\" -std=c++14 -fvisibility=hidden
clang: error: the clang compiler does not support '-march=native'
error: command '/usr/bin/clang' failed with exit code 1
[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