How to Install faiss-cpu in Python
A library for efficient similarity search and clustering of dense vectors.
pip install faiss-cpu
What is faiss-cpu?
A library for efficient similarity search and clustering of dense vectors.
This repository provides CI scripts to build wheel packages for the faiss library.
- Builds wheels with cibuildwheel. - Build backend uses scikit-build-core. - Default BLAS backend is OpenBLAS on Linux/Windows and the Accelerate framework on macOS. - Support various build options for customization.
The PyPI distributed wheels include the following extentions.
Quick Start
Minimal example to get started with faiss-cpu:
import faiss_cpu
print(faiss_cpu.__version__)
Installation
pip (standard)
pip install faiss-cpu
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install faiss-cpu
pip3
pip3 install faiss-cpu
conda
conda install -c conda-forge faiss-cpu
Poetry
poetry add faiss-cpu
Dependencies
Installing faiss-cpu will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import faiss_cpu; print(faiss_cpu.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing faiss-cpu with pip.
ModuleNotFoundError: No module named 'faiss_cpu'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install faiss-cpu. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'faiss_cpu' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install faiss-cpu to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'faiss_cpu'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show faiss-cpu and upgrade with pip install --upgrade faiss-cpu.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install faiss-cpu. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user faiss-cpu
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org faiss-cpu
MemoryError when loading data
Cause: Dataset is too large to fit in RAM.
Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.
Recent Releases
| Version | Released |
|---|---|
1.13.2 latest |
2025-12-24 |
1.13.1 |
2025-12-05 |
1.13.0 |
2025-11-17 |
1.12.0 |
2025-08-13 |
1.11.0.post1 |
2025-07-15 |
Manage faiss-cpu
Upgrade to latest version
pip install --upgrade faiss-cpu
Install a specific version
pip install faiss-cpu==1.13.2
Uninstall
pip uninstall faiss-cpu
Check what is installed
pip show faiss-cpu