jlonge4 / local_llama

This repo is to showcase how you can run a model locally and offline, free of OpenAI dependencies.
Apache License 2.0
240 stars 39 forks source link

ERROR: Failed building wheel for faiss-cpu #15

Open plsnotracking opened 8 months ago

plsnotracking commented 8 months ago

Hello, trying to setup the project, running into issues.

Previous issues that seem related

Maybe this should be an issue for the upstream library itself.

Maybe these are related?

System Config

Steps to repro the error

I have ollama running in a docker container and can be accessed at http://localhost:11434.

# copy the repo
git clone https://github.com/jlonge4/local_llama.git

# root dir
cd local_llama

# check python version
❯ python3 --version
Python 3.12.2

# create a python virtual env
python3 -m venv llama

# activate env
source llama/bin/activate

# fulfill requirements
python3 -m pip install -r requirements.txt

Failure

Error Stacktrace:

Using cached cryptography-42.0.5-cp39-abi3-macosx_10_12_universal2.whl (5.9 MB)
Using cached cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl (177 kB)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
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
  ╰─> [8 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
      error: command 'swig' failed: No such file or directory
      [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

Anything that I could do to fix it?

Thank you.

jlonge4 commented 8 months ago

@plsnotracking Ahhh I see. Perhaps you are onto something with the python version. I have been thinking of making this a docker container so maybe that would resolve it for everyone.

plsnotracking commented 7 months ago

@jlonge4 anything I can do to help?

kkose commented 6 months ago

I had the same issue. I created a clean-slate conda environment with python version 3.10 and in that environment the installation worked.

jlonge4 commented 6 months ago

@kkose @plsnotracking what do you two think about making this project use an in memory document store. Pros: none of these issues. Cons: your document index would only persist for the duration of your app session, and you'd have to reindex each time you ran it. Thoughts?

plsnotracking commented 3 months ago

If it's not taxing enough on the system, I guess, having a long running job wouldn't hurt much tbh. Makes it at least usable.

jlonge4 commented 3 months ago

@plsnotracking Done! The latest version uses a persisted doc store

plsnotracking commented 3 months ago

Let me take it for a spin over the weekend.