Chroma pip install "Failed to build hnswlib" Error

Share
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. 1. Fix the compile step

    1. If you see "clang: error: the clang compiler does not support -march=native", run export HNSWLIB_NO_NATIVE=1
    2. On Mac run xcode-select --install
    3. Retry pip install chromadb
    Did this fix it?
  2. 2. Windows

    1. Install the Microsoft C++ Build Tools (see the steps linked from the Chroma troubleshooting page)
    2. 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 us
Fixed it? Share this guide

Other Chroma errors

All 11 Chroma errors and fixes →