hwchase17/chat-your-data

ModuleNotFoundError: No module named 'faiss.swigfaiss_avx2'

VGraupera opened this issue · 5 comments

hitting this error, created new miniconda environment with python 3.11 on m2 mac, looked online at how to fix swigfaiss_avx2 but didnt find good solution. any tips appreciated

(langchain) 2023/chat-your-data[master|] % python app.py

Traceback (most recent call last):
File "/Users/vidalgraupera/code/2023/chat-your-data/app.py", line 7, in
vectorstore = pickle.load(f)
^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'faiss.swigfaiss_avx2'

running into same issue on mac m1. seems to be a bunch of issues with faiss and the new mac m1 and m2 models.

found a workaround with making Faiss compatible outside the conda environment.

facebookresearch/faiss#1773 (comment)

gpww commented

running into same issue on windows seriver 2019, created new conda environment with python 3.10:

(LangChain) D:\Code\LangChain\chat-your-data>python app.py
Traceback (most recent call last):
File "D:\Code\LangChain\chat-your-data\app.py", line 10, in
vectorstore = pickle.load(f)
ModuleNotFoundError: No module named 'faiss.swigfaiss_avx2'

this error occurs when you use a pickle file generated on a different CPU architecture which supports avx2. Try to generate your own pickle file

Hi siddhantdante I ran into the same error, how can I generate my own pickle file, given I am in a windows OS? , and based on what should i generate it?

Had the same problem on a mini M2. Fixed in by running "python ingest_data.py" to create a new pickle file.
This step is covered in the blog post https://blog.langchain.dev/tutorial-chatgpt-over-your-data/ which I failed to read carefully enough.