Linux conda安装Faiss:No module named '_swigfaiss'

Disclaimer: This article is original, All Rights Reserved https://blog.csdn.net/weixin_41864878/article/details/88683170

Ensure anaconda in Python as 3.x, measured python2.7 not installed on the
anaconda in python can replace direct conda install python = 3.6
or create a new environment conda create the anaconda in -n py3.6 python = 3.6
also need to ensure conda install openblas swig

try

# CPU version only
conda install faiss-cpu -c pytorch
# Make sure you have CUDA installed before installing faiss-gpu, otherwise it falls back to CPU version
conda install faiss-gpu -c pytorch # [DEFAULT]For CUDA8.0
conda install faiss-gpu cuda90 -c pytorch # For CUDA9.0
conda install faiss-gpu cuda92 -c pytorch # For CUDA9.2
# cuda90/cuda91 shown above is a feature, it doesn't install CUDA for you.

If the error ModuleNotFoundError: No Module named 'faiss.swigfaiss_gpu'
Conda install MKL
can be solved

Reference: https://github.com/facebookresearch/faiss/issues/485

Guess you like

Origin blog.csdn.net/weixin_41864878/article/details/88683170