kyamagu / faiss-wheels

Unofficial faiss wheel builder
MIT License
298 stars 38 forks source link

Faiss fails to install on MacOS M2 Macbook #90

Closed yackermann closed 10 months ago

yackermann commented 11 months ago

Describe the bug While trying to install faiss on MacOS

To Reproduce Describe the steps to reproduce the behavior:

pip install faiss-cpu

Downloading faiss-cpu-1.7.2.tar.gz (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 4.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: faiss-cpu
  Building wheel for faiss-cpu (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for faiss-cpu (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [78 lines of output]
      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 -python -c++ -Doverride= -I/usr/local/include -Ifaiss -doxygen -o faiss/faiss/python/swigfaiss_wrap.cpp faiss/faiss/python/swigfaiss.i
      faiss/faiss/python/swigfaiss.i:253: Error: Unable to find 'faiss/impl/platform_macros.h'
      faiss/faiss/python/swigfaiss.i:257: Error: Unable to find 'faiss/utils/ordered_key_value.h'
      faiss/faiss/python/swigfaiss.i:258: Error: Unable to find 'faiss/utils/Heap.h'
      faiss/faiss/python/swigfaiss.i:263: Error: Unable to find 'faiss/utils/AlignedTable.h'
      faiss/faiss/python/swigfaiss.i:264: Error: Unable to find 'faiss/utils/partitioning.h'
      faiss/faiss/python/swigfaiss.i:265: Error: Unable to find 'faiss/utils/hamming.h'
      faiss/faiss/python/swigfaiss.i:369: Error: Unable to find 'faiss/utils/utils.h'
      faiss/faiss/python/swigfaiss.i:370: Error: Unable to find 'faiss/utils/distances.h'
      faiss/faiss/python/swigfaiss.i:371: Error: Unable to find 'faiss/utils/random.h'
      faiss/faiss/python/swigfaiss.i:373: Error: Unable to find 'faiss/MetricType.h'
      faiss/faiss/python/swigfaiss.i:376: Error: Unable to find 'faiss/Index.h'
      faiss/faiss/python/swigfaiss.i:377: Error: Unable to find 'faiss/IndexFlatCodes.h'
      faiss/faiss/python/swigfaiss.i:378: Error: Unable to find 'faiss/IndexFlat.h'
      faiss/faiss/python/swigfaiss.i:379: Error: Unable to find 'faiss/Clustering.h'
      faiss/faiss/python/swigfaiss.i:381: Error: Unable to find 'faiss/utils/extra_distances.h'
      faiss/faiss/python/swigfaiss.i:385: Error: Unable to find 'faiss/impl/ProductQuantizer.h'
      faiss/faiss/python/swigfaiss.i:386: Error: Unable to find 'faiss/impl/AdditiveQuantizer.h'
      faiss/faiss/python/swigfaiss.i:387: Error: Unable to find 'faiss/impl/ResidualQuantizer.h'
      faiss/faiss/python/swigfaiss.i:388: Error: Unable to find 'faiss/impl/LocalSearchQuantizer.h'
      faiss/faiss/python/swigfaiss.i:390: Error: Unable to find 'faiss/VectorTransform.h'
      faiss/faiss/python/swigfaiss.i:391: Error: Unable to find 'faiss/IndexPreTransform.h'
      faiss/faiss/python/swigfaiss.i:392: Error: Unable to find 'faiss/IndexRefine.h'
      faiss/faiss/python/swigfaiss.i:393: Error: Unable to find 'faiss/IndexLSH.h'
      faiss/faiss/python/swigfaiss.i:394: Error: Unable to find 'faiss/impl/PolysemousTraining.h'
      faiss/faiss/python/swigfaiss.i:395: Error: Unable to find 'faiss/IndexPQ.h'
      faiss/faiss/python/swigfaiss.i:396: Error: Unable to find 'faiss/IndexAdditiveQuantizer.h'
      faiss/faiss/python/swigfaiss.i:397: Error: Unable to find 'faiss/impl/io.h'
      faiss/faiss/python/swigfaiss.i:399: Error: Unable to find 'faiss/invlists/InvertedLists.h'
      faiss/faiss/python/swigfaiss.i:400: Error: Unable to find 'faiss/invlists/InvertedListsIOHook.h'
      faiss/faiss/python/swigfaiss.i:402: Error: Unable to find 'faiss/invlists/BlockInvertedLists.h'
      faiss/faiss/python/swigfaiss.i:403: Error: Unable to find 'faiss/invlists/DirectMap.h'
      faiss/faiss/python/swigfaiss.i:406: Error: Unable to find 'faiss/IndexIVF.h'
      faiss/faiss/python/swigfaiss.i:411: Error: Unable to find 'faiss/IVFlib.h'
      faiss/faiss/python/swigfaiss.i:412: Error: Unable to find 'faiss/impl/ScalarQuantizer.h'
      faiss/faiss/python/swigfaiss.i:413: Error: Unable to find 'faiss/IndexScalarQuantizer.h'
      faiss/faiss/python/swigfaiss.i:414: Error: Unable to find 'faiss/IndexIVFSpectralHash.h'
      faiss/faiss/python/swigfaiss.i:415: Error: Unable to find 'faiss/IndexIVFAdditiveQuantizer.h'
      faiss/faiss/python/swigfaiss.i:416: Error: Unable to find 'faiss/impl/HNSW.h'
      faiss/faiss/python/swigfaiss.i:417: Error: Unable to find 'faiss/IndexHNSW.h'
      faiss/faiss/python/swigfaiss.i:419: Error: Unable to find 'faiss/impl/kmeans1d.h'
      faiss/faiss/python/swigfaiss.i:422: Error: Unable to find 'faiss/impl/NNDescent.h'
      faiss/faiss/python/swigfaiss.i:423: Error: Unable to find 'faiss/IndexNNDescent.h'
      faiss/faiss/python/swigfaiss.i:425: Error: Unable to find 'faiss/IndexIVFFlat.h'
      faiss/faiss/python/swigfaiss.i:426: Error: Unable to find 'faiss/impl/NSG.h'
      faiss/faiss/python/swigfaiss.i:427: Error: Unable to find 'faiss/IndexNSG.h'
      faiss/faiss/python/swigfaiss.i:432: Error: Unable to find 'faiss/invlists/OnDiskInvertedLists.h'
      faiss/faiss/python/swigfaiss.i:435: Error: Unable to find 'faiss/impl/lattice_Zn.h'
      faiss/faiss/python/swigfaiss.i:436: Error: Unable to find 'faiss/IndexLattice.h'
      faiss/faiss/python/swigfaiss.i:439: Error: Unable to find 'faiss/IndexIVFPQ.h'
      faiss/faiss/python/swigfaiss.i:440: Error: Unable to find 'faiss/IndexIVFPQR.h'
      faiss/faiss/python/swigfaiss.i:441: Error: Unable to find 'faiss/Index2Layer.h'
      faiss/faiss/python/swigfaiss.i:443: Error: Unable to find 'faiss/IndexPQFastScan.h'
      faiss/faiss/python/swigfaiss.i:444: Error: Unable to find 'faiss/IndexIVFPQFastScan.h'
      faiss/faiss/python/swigfaiss.i:445: Error: Unable to find 'faiss/utils/quantize_lut.h'
      faiss/faiss/python/swigfaiss.i:447: Error: Unable to find 'faiss/IndexBinary.h'
      faiss/faiss/python/swigfaiss.i:448: Error: Unable to find 'faiss/IndexBinaryFlat.h'
      faiss/faiss/python/swigfaiss.i:449: Error: Unable to find 'faiss/IndexBinaryIVF.h'
      faiss/faiss/python/swigfaiss.i:450: Error: Unable to find 'faiss/IndexBinaryFromFloat.h'
      faiss/faiss/python/swigfaiss.i:451: Error: Unable to find 'faiss/IndexBinaryHNSW.h'
      faiss/faiss/python/swigfaiss.i:452: Error: Unable to find 'faiss/IndexBinaryHash.h'
      faiss/faiss/python/swigfaiss.i:454: Error: Unable to find 'faiss/impl/ThreadedIndex.h'
      faiss/faiss/python/swigfaiss.i:458: Error: Unable to find 'faiss/IndexShards.h'
      faiss/faiss/python/swigfaiss.i:462: Error: Unable to find 'faiss/IndexReplicas.h'
      faiss/faiss/python/swigfaiss.i:466: Error: Unable to find 'faiss/MetaIndexes.h'
      faiss/faiss/python/swigfaiss.i:481: Error: Unable to find 'faiss/impl/AuxIndexStructures.h'
      faiss/faiss/python/swigfaiss.i:678: Error: Unable to find 'faiss/index_io.h'
      faiss/faiss/python/swigfaiss.i:679: Error: Unable to find 'faiss/clone_index.h'
      faiss/faiss/python/swigfaiss.i:683: Error: Unable to find 'faiss/AutoTune.h'
      faiss/faiss/python/swigfaiss.i:684: Error: Unable to find 'faiss/index_factory.h'
      faiss/faiss/python/swigfaiss.i:685: Error: Unable to find 'faiss/MatrixStats.h'
      error: command '/opt/homebrew/bin/swig' 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
Failed to build faiss-cpu
ERROR: Could not build wheels for faiss-cpu, which is required to install pyproject.toml-based projects

Expected behavior Expected it to install

Desktop (please complete the following information):

travelhawk commented 10 months ago

Same error on Windows 10

kyamagu commented 10 months ago

Python 3.12 is not supported yet #87