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

版权声明:本文章为原创,未经许可不得转载 https://blog.csdn.net/weixin_41864878/article/details/88683170

确保anaconda中Python为3.x,实测python2.7装不上
anaconda中更换python可以直接conda install python=3.6
或者在anaconda中创建新的环境conda create -n py3.6 python=3.6
还需要确保conda install openblas swig

尝试

# 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.

如果报错ModuleNotFoundError: No module named ‘faiss.swigfaiss_gpu’
conda install mkl
即可解决

参考:https://github.com/facebookresearch/faiss/issues/485

猜你喜欢

转载自blog.csdn.net/weixin_41864878/article/details/88683170