neurogen-dev/NeuroAPI

After upgrade from Fedora 38 to 39, start_webui_linux.sh - FAILED - Building wheel for faiss-cpu (pyproject.toml) did not run successfully

mtatarin1976 opened this issue · 2 comments

Describe the bug
After upgrade from Fedora 38 to 39, start_webui_linux.sh - FAILED - Building wheel for faiss-cpu (pyproject.toml) did not run successfully

To Reproduce
Upgrade to Fedora 39
cd ./NeuroGPT
./start_webui_linux.sh

Expected behavior
start_webui_linux.sh started

Screenshots
image
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 -DSWIGWORDSIZE64 -module swigfaiss -o faiss/faiss/python/swigfaiss_wrap.cpp faiss/faiss/python/swigfaiss.i
Traceback (most recent call last):
File "/root/NeuroGPT/venv/bin/swig", line 5, in
from swig import swig
ModuleNotFoundError: No module named 'swig'
error: command '/root/NeuroGPT/venv/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
Building wheel for aiohttp (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for aiohttp (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [160 lines of output]

Desktop (please complete the following information):

  • Fedora 39 Linux x86 64

I found the root cause and the workaround.

Fedora 39 uses the new Python 3.12 version by default, but faiss_cpu supported 3.11 only and faiss_cpu wheel (binary install package) is not compatible with 3.12 too, therefore the workaround is to use python 3.11 with virtual environment:

dnf install python3.11
cd ./NeuroGPT
deactivate # in case is if you have activated venv before with python 3.12 support
python3.11 -m venv venv311
source venv311/bin/activate
python --version # check that python version in new virtual environment is the 3.11 and is Not 3.12
pip install faiss-cpu # doublecheck that you can successfully install faiss-cpu now

#you may edit, but I did no check, start_webui_linux.sh to use venv311 or do it like me:
mv ./venv ./venv.old
ln -s ./venv311 ./venv

./start_webui_linux.sh

This workaround is for Fedora 39 that uses latest new Python 3.12 by default and faiss-cpu is not supported 3.12 yet at this moment. When faiss-cpu project will build version compatible with 3.12 we will not needed in this workaround anymore.

I put my troubleshooting and the workaround with all explanation already above.