kyamagu / faiss-wheels

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

CPython 3.12 wheels #87

Closed dlqqq closed 10 months ago

dlqqq commented 11 months ago

(cc @kyamagu for visibility)

There are currently no CPython 3.12 wheels on PyPI (https://pypi.org/project/faiss-cpu/#files). This causes an error on platforms using CPython 3.12 which are unable to build faiss-cpu from source.

Can the contributors publish a new minor/patch release that includes CPython 3.12 for all platforms?

Example output, on an M1 Mac running CPython 3.12:

...
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
  ╰─> [12 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 -module swigfaiss -o faiss/faiss/python/swigfaiss_wrap.cpp faiss/faiss/python/swigfaiss.i
      Traceback (most recent call last):
        File "/opt/miniconda3/envs/jupyter-ai-jl4-pip/bin/swig", line 5, in <module>
          from swig import swig
      ModuleNotFoundError: No module named 'swig'
      error: command '/opt/miniconda3/envs/jupyter-ai-jl4-pip/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
kyamagu commented 11 months ago

The current faiss release does not work for CPython 3.12 due to the deprecation of distutils module. https://peps.python.org/pep-0632/

Please file a bug in the upsteam faiss repository

kyamagu commented 11 months ago

Upstream PR https://github.com/facebookresearch/faiss/pull/3191

Youjin1985 commented 10 months ago

And 3.11 as well when possible, please

kyamagu commented 10 months ago

This PR implements fix for CPython 3.12+. The next release will include the update.

msdrigg commented 9 months ago

Any timeline for release? Even with just this PR many users would benefit.

kyamagu commented 9 months ago

@msdrigg Ask for the release schedule in the upstream repository

dlqqq commented 9 months ago

@msdrigg Looks like we can expect a release in 2 weeks: https://github.com/facebookresearch/faiss/issues/3263#issuecomment-1966383696