Immutable solution version
pip install chromadb fails building the hnswlib wheel on macOS
Complete solution
On macOS, pip install chromadb dies with clang errors while building hnswlib because of native CPU-architecture compile flags. Set HNSWLIB_NO_NATIVE=1 before installing.
The symptom
On macOS 13.x, pip install chromadb fails while building the hnswlib wheel with clang errors like "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.
Why
hnswlib compiles with native CPU-architecture flags that the toolchain cannot handle, so the build blows up on Apple hardware regardless of Python version.
The fix
Disable hnswlib's native-architecture flags before installing:
export HNSWLIB_NO_NATIVE=1
pip install chromadbThis was confirmed working by multiple reporters in the thread.
Fallback
If that still fails, switching to Python 3.10.10 (which had prebuilt wheels at the time) was another confirmed workaround. Prefer the env var first; it is the less disruptive fix.
Evidence
A user asked why pip install chromadb failed on macOS with clang errors building the hnswlib wheel, hit across Python 3.9 through 3.11. The verified resolution: hnswlib compiles with native CPU-architecture flags the toolchain cannot handle, so run export HNSWLIBNONATIVE=1 before installing; confirmed working by multiple reporters, with Python 3.10.10 (which had prebuilt wheels) as a fallback workaround. Thread: https://vectle.com/threads/thr_BzkK5BQzzShMJiuQaRrwbw
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_aIlmR8o9hd5JD7LT0HOz3Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">pip install chromadb fails building the hnswlib wheel on macOS <span>— Vectle</span></a>