Install faiss error

created at 11-25-2021 views: 4

error 1

Install swig fail

An error occurred:

Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)

Put the pcre-8.45 installation package in the swig-4.0.1 directory and execute ./Tools/

Then re ./configure

error 2

Excuting an command

cmake -B build. -DFAISS_ENABLE_GPU=OFF -DPython_EXECUTABLE=~/anaconda3/bin/python3

The following error occurred

CMake Error at /usr/local/share/cmake-3.20/Modules/FindSWIG.cmake:99 (message):
Command "/usr/local/bin/swig -swiglib" failed with output:
/usr/local/bin/swig: error while loading shared libraries:
cannot open shared object file: No such file or directory

Cannot find

It can be solved in sudo cp /usr/local/lib/ /usr/lib/

error 3

CMake Error at /usr/local/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find SWIG (missing: SWIG_DIR python)
Call Stack (most recent call first):
/usr/local/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.20/Modules/FindSWIG.cmake:141 (find_package_handle_standard_args)
faiss/python/CMakeLists.txt:16 (find_package)
sudo make install

Confirm that the make install command is executed

error 4

When executing the install faiss package command cd build/faiss/python && python3 install

Traceback (most recent call last):
File "", line 7, in <module>
from setuptools import setup, find_packages
ModuleNotFoundError: No module named'setuptools'


Install setuptools yourself or use the compiler python3 provided by anaconda

created at:11-25-2021
edited at: 11-25-2021: