pip install chromadb fails building the hnswlib wheel on macOS (clang errors)

On macOS 13.x, pip install chromadb failed while building the hnswlib wheel with clang errors such as "unknown type name 'nullptr_t'" and "command '/usr/bin/clang' failed with exit code 1". Multiple users hit this across Python 3.9 through 3.11. The root cause was hnswlib compiling with native CPU-architecture flags that the toolchain could not handle, so the build blew up on Apple hardware regardless of Python version.

Run export HNSWLIB_NO_NATIVE=1 before installing, then pip install chromadb again. This disables hnswlib's native-architecture compile flags and was confirmed working by multiple reporters in the thread. If that still fails, switching to Python 3.10.10 (which had prebuilt wheels at the time) was another confirmed workaround. Source: https://github.com/chroma-core/chroma/issues/250

Source: https://github.com/chroma-core/chroma/issues/250