Chroma pip install "Failed to build hnswlib" Error
Workaround available macOS, Windows, Linux Updated November 15, 2026Based on 3 user reportsHow we research
Quick answer
The pip install fails compiling hnswlib. On macOS install Xcode tools; if clang rejects -march=native set HNSWLIB_NO_NATIVE=1.
Most likely fix: Fix the compile step
How to fix it
Try these in order — the most common fix is first.
1. Fix the compile step
- If you see "clang: error: the clang compiler does not support -march=native", run export HNSWLIB_NO_NATIVE=1
- On Mac run xcode-select --install
- Retry pip install chromadb
Did this fix it?2. Windows
- Install the Microsoft C++ Build Tools (see the steps linked from the Chroma troubleshooting page)
- Retry pip install chromadb
Did this fix it?
Symptoms
pip install chromadb ends with "Failed to build hnswlib" or "Could not build wheels for hnswlib".
Why it happens
- No C++ compiler or build tools installed
- clang rejecting -march=native
- Windows without build tools
This guide also covers
- chromadb failed to build hnswlib
- pip install chromadb error
- could not build wheels for hnswlib
Still not working?
If Chroma keeps failing, you're not alone. See every Chroma problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Chroma errors
- Chroma "Your system has an unsupported version of sqlite3" Error
- Chroma InvalidDimensionException: Embedding Dimension Does Not Match Collection
- Chroma Data Disappears After Restart (Persistence Fix)
- Chroma "Collection Not Found" Error
- Chroma "Collection Already Exists" UniqueConstraintError
- Chroma "sqlite3.OperationalError: database is locked"
- Chroma "Could not connect to tenant default_tenant" Error
- Chroma "Cannot return the results in a contiguous 2D array. Probably ef or M is too small"