chroma: Chromadb fails to install on MacOS 13.2.1 (i9) with latest XCode

pip3 install chromadb on MacOS 13 (i9 hardware) fails:

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/q_
      creating var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn
      creating var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c /var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/tmpq86o7pij.cpp -o var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/tmpq86o7pij.o -std=c++14
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c /var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/tmpkpsz3vsz.cpp -o var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/tmpkpsz3vsz.o -fvisibility=hidden
      building 'hnswlib' extension
      creating build
      creating build/temp.macosx-10.9-universal2-cpython-311
      creating build/temp.macosx-10.9-universal2-cpython-311/python_bindings
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/private/var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/pip-build-env-i22faqo5/overlay/lib/python3.11/site-packages/pybind11/include -I/private/var/folders/q_/f5sh90n16hb55w1tz2_s2vqw0000gn/T/pip-build-env-i22faqo5/overlay/lib/python3.11/site-packages/numpy/core/include -I./hnswlib/ -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c ./python_bindings/bindings.cpp -o build/temp.macosx-10.9-universal2-cpython-311/./python_bindings/bindings.o -O3 -march=native -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO=\"0.7.0\" -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

Unfortunately, clang cannot be updated beyond 14.0.0 on non-M1 hardware (related) because it is managed by XCode

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 36 (3 by maintainers)

Most upvoted comments

I looked inside the hnswlib’s setup.py and found that it checks for a HNSWLIB_NO_NATIVE flag…

export HNSWLIB_NO_NATIVE=1

Once that was set, I gather pip install didn’t try to use -march=native and installation worked. Hope this helps someone out there…

I looked inside the hnswlib’s setup.py and found that it checks for a HNSWLIB_NO_NATIVE flag…

export HNSWLIB_NO_NATIVE=1

Once that was set, I gather pip install didn’t try to use -march=native and installation worked. Hope this helps someone out there…

This worked for me! Saved my day!

@jeffchuber thanks!

In my case, downgrading the Python version in Docker from: python:3.11-slim to python:3.10.10

Solved the installation issue.

I’ve solved this with Miniconda on an M2 MacBook:

brew install miniforge
conda init zsh
conda activate base
conda install chromadb

thanks everyone for reporting

im looking into this, with haste!

我已收到,感谢你的来信!

I am using a Apple M1 with macOS Venture Version 13.3.1. I’ve tried the following:

  • multiple python versions (like 10.10.10)
  • set HNSWLIB_NO_NATIVE=1
  • arch -x86_64 zsh
  • %pip install hnswlib==0.6.2
  • %pip install chromadb==0.3.15

and I still get this error: Collecting hnswlib>=0.7 (from chromadb>=0.3.10->-r requirements.txt (line 3)) Using cached hnswlib-0.7.0.tar.gz (33 kB) Installing build dependencies … done Getting requirements to build wheel … error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 353, in <module> main() File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 335, in main json_out[‘return_val’] = hook(**hook_input[‘kwargs’]) File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 118, in get_requires_for_build_wheel return hook(config_settings) File “/private/var/folders/gg/48hbz7kj2lb38l4tn6f5l8rc0000gp/T/pip-build-env-09rye5ob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py”, line 341, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[‘wheel’]) File “/private/var/folders/gg/48hbz7kj2lb38l4tn6f5l8rc0000gp/T/pip-build-env-09rye5ob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py”, line 323, in _get_build_requires self.run_setup() File “/private/var/folders/gg/48hbz7kj2lb38l4tn6f5l8rc0000gp/T/pip-build-env-09rye5ob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py”, line 338, in run_setup exec(code, locals()) File “<string>”, line 74, in <module> File “<string>”, line 91, in BuildExt ValueError: list.remove(x): x not in list [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.