Error while importing SentenceTransformer in python

3.3k Views Asked by At

I have installed package sentence-transformers using "pip install sentence-transformers".

But when I tried to import sentence-transformers in python, I am getting below error.

from sentence_transformers import SentenceTransformer
Traceback (most recent call last):

  File "C:\ProgramData\Anaconda3\lib\site-packages\faiss\loader.py", line 34, in <module>
    from .swigfaiss import *

  File "C:\ProgramData\Anaconda3\lib\site-packages\faiss\swigfaiss.py", line 13, in <module>
    from . import _swigfaiss

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

I tried to uninstall and install the package again but it didn't help, also checked the requirement listed in the link below "We recommend Python 3.6 or higher, PyTorch 1.6.0 or higher and transformers v3.1.0 or higher. The code does not work with Python 2.7.", all these requirements are satisfied.

https://pypi.org/project/sentence-transformers/#:~:text=Install%20from%20sources,with%20the%20matching%20CUDA%20Version.   Can anyone please help with this.

0

There are 0 best solutions below