Error installing faiss-cpu: "error: command 'swig.exe' failed: None"

4k views Asked by At

I am trying to install paddleclas and got this error. I tried to find solutions on the internet but they did not work for me. I have installed both Cmake, pyproject.tom, pep517.

After install swig and faiss-cpu, I got this error:

Building wheels for collected packages: faiss-cpu
  Building wheel for faiss-cpu (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [84 lines of output]
      C:\Users\anhdu\Documents\.vscode\PaddleOCR_test_env\lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
      running bdist_wheel
      running build
      running build_py
      running build_ext
      building 'faiss._swigfaiss' extension
      swigging faiss\faiss\python\swigfaiss.i to faiss\faiss\python\swigfaiss_wrap.cpp
      swig.exe -python -c++ -Doverride= -I/usr/local/include -Ifaiss -DSWIGWIN -o faiss\faiss\python\swigfaiss_wrap.cpp faiss\faiss\python\swigfaiss.i
      faiss\faiss\python\swigfaiss.i(250) : Error: Unable to find 'faiss\impl\platform_macros.h'
      faiss\faiss\python\swigfaiss.i(254) : Error: Unable to find 'faiss\utils\ordered_key_value.h'
      faiss\faiss\python\swigfaiss.i(255) : Error: Unable to find 'faiss\utils\Heap.h'
      faiss\faiss\python\swigfaiss.i(260) : Error: Unable to find 'faiss\utils\AlignedTable.h'
      faiss\faiss\python\swigfaiss.i(261) : Error: Unable to find 'faiss\utils\partitioning.h'
      faiss\faiss\python\swigfaiss.i(262) : Error: Unable to find 'faiss\utils\hamming.h'
  error: command 'C:\\Users\\anhdu\\Documents\\.vscode\\PaddleOCR_test_env\\Scripts\\swig.exe' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for faiss-cpu
  Running setup.py clean for faiss-cpu
Failed to build faiss-cpu
ERROR: Could not build wheels for faiss-cpu, which is required to install pyproject.toml-based projects
0

There are 0 answers