-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: No module named '_swigfaiss #821
Comments
The loader cannot find |
Ok I figured it out, I needed to install openMP and did so using this: |
how to do on centos sys ,@shashi-netra |
It should not be so:pip install faiss should do:CPU version onlyconda install faiss-cpu -c pytorch GPU versionconda install faiss-gpu cudatoolkit=8.0 -c pytorch # For CUDA8 link: https://github.com/facebookresearch/faiss/blob/master/INSTALL.md |
|
For those who are working with pip and not conda, if you have installed it with,
uninstall it. And then install faiss with,
This worked for me 👍 |
Just install three things in the following order and your problem Is solved pip3 install faiss |
Thank you @Arjunsankarlal. I am on Mac and I had to remove both the Mac users:
Once installed you may see the below error:
You can fix the above error by installing the |
Thanks a lot! it's really helpful. |
very nice |
i use
but still have error: |
(tf19-py36) root@recom_algresearch_ubuntugpu73v99_syq:/data/relateRecom/gsm/ComiRec# conda install faiss-gpu cudatoolkit=11.3.1 -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
(tf19-py36) root@recom_algresearch_ubuntugpu73v99_syq:/data/relateRecom/gsm/ComiRec# python
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faiss
Traceback (most recent call last):
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss_gpu.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
File "<frozen importlib._bootstrap>", line 560, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/__init__.py", line 21, in <module>
from .swigfaiss_gpu import *
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss_gpu.py", line 17, in <module>
_swigfaiss_gpu = swig_import_helper()
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss_gpu.py", line 16, in swig_import_helper
return importlib.import_module('_swigfaiss_gpu')
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_swigfaiss_gpu'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
File "<frozen importlib._bootstrap>", line 560, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: libmkl_gnu_thread.so: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/__init__.py", line 28, in <module>
from .swigfaiss import *
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss.py", line 17, in <module>
_swigfaiss = swig_import_helper()
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/site-packages/faiss/swigfaiss.py", line 16, in swig_import_helper
return importlib.import_module('_swigfaiss')
File "/data/relateRecom/anaconda3/envs/tf19-py36/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_swigfaiss' |
|
Summary
Installed faiss using pip3 on Ubuntu 16 (cpu)
I am unable to import faiss into python3 and it results in the following error
ImportError: No module named '_swigfaiss'
See error log below, I have installed (and re-installed!)
libomp
but no luck.What could possibly be wrong?
Platform
Ubuntu 16 & Python3
Running on:
Interface:
Reproduction instructions
The text was updated successfully, but these errors were encountered: