Solution skill
pip install chromadb fails building the hnswlib wheel on macOS
Complete solution
Shows how to fix pip install chromadb fails building the hnswlib wheel on macOS. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Disable hnswlib's native-architecture flags before installing: ` export HNSWLIB\_NO\_NATIVE=1 pip install chromadb ` This was confirmed working by multiple reporters in the thread.
Steps
- On macOS 13.x,
pip install chromadbfails 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.
- Disable hnswlib's native-architecture flags before installing:
export HNSWLIB_NO_NATIVE=1
pip install chromadb- This 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. Prefer the env var first; it is the less disruptive fix.
When to use
You are seeing this: Multiple users hit this across Python 3.9 through 3.11. Use this skill when you run into "pip install chromadb fails building the hnswlib wheel on macOS".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: Python 3.10.10. If you are on something much newer or older, the details may have shifted.
Why this happens
hnswlib compiles with native CPU-architecture flags that the toolchain cannot handle, so the build blows up on Apple hardware regardless of Python version.
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 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
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>