user9270170
user9270170

Reputation:

windows import faiss error:DLL load failed

I install faiss-cpu form pypi.org

But when I use this code:

import faiss

the error message is:

ImportError                               Traceback (most recent call last)
~\Anaconda3\lib\site-packages\faiss\loader.py in <module>
     33         logger.info("Loading faiss.")
---> 34         from .swigfaiss import *
     35 

~\Anaconda3\lib\site-packages\faiss\swigfaiss.py in <module>
     12 if __package__ or "." in __name__:
---> 13     from . import _swigfaiss
     14 else:

ImportError: DLL load failed: The specified module could not be found.

How to fix it?

Upvotes: 5

Views: 7398

Answers (3)

Dman Cannon
Dman Cannon

Reputation: 126

Add your DLL location of python (C:\Program Files\Python<version.no>\DLLs) in Environment variables of Path

Upvotes: 1

ppwater
ppwater

Reputation: 2277

The faiss on PyPi is, according to the project description, It says

an Unofficial prebuilt binary for Linux and MacOS.

It seems you have to switch to Linux or MacOS to run it. But you are running on windows, which is not supported. You can read the official installation instructions for Faiss.

Upvotes: 0

Sagun Devkota
Sagun Devkota

Reputation: 505

If you have installed faiss using pip. Then use

conda install -c conda-forge faiss

In anaconda prompt.

Upvotes: 6

Related Questions