I'm trying to install the faiss-cpu
package in my Python environment, but I'm encountering a build error related to swig.exe
during the wheel building process. I'm working within a virtual environment on Windows and using Python 3.12.0.
Here's the error message I receive when I run pip install faiss-cpu
:
error: subprocess-exited-with-error
× Building wheel for faiss-cpu (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [details of the error]
swig.exe -python -c++ -Doverride= -I/usr/local/include -Ifaiss -doxygen -DSWIGWIN -module swigfaiss -o faiss\faiss\python\swigfaiss_wrap.cpp faiss\faiss\python\swigfaiss.i
error: command 'swig.exe' failed: None
Note: I have noticed a notification about a newer version of pip being available. Not sure if that's part of the issue.
To troubleshoot, I've attempted the following:
swig
is installed and the path to swig.exe
is in my system's PATH environment variable. Running swig -version
in the command prompt returns the version correctly.I expected the package to install without any issues as I followed the standard pip installation procedure. I'm wondering if the issue is specific to my Python version (3.12.0) or some other configuration on my system.
I got a similar error on my mac when I tried to install the faiss-cpu 1.11.0. Then it worked when I installed 1.10.0 version instead (pip install faiss-cpu==1.10.0)