question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'faiss.swigfaiss_avx2'

See original GitHub issue

Hi,

With faiss-cpu on linux I get an error:

Traceback:
env/lib/python3.6/site-packages/faiss/loader.py:31: in <module>
    from .swigfaiss_avx2 import *
E   ModuleNotFoundError: No module named 'faiss.swigfaiss_avx2'

During handling of the above exception, another exception occurred:
env/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
xxx/tests/handlers/xxx.py:6: in <module>
    from xxx.handlers import xxx as xxx_handler
xxx/handlers/xxx.py:2: in <module>
    import faiss
env/lib/python3.6/site-packages/faiss/__init__.py:17: in <module>
    from .loader import *
env/lib/python3.6/site-packages/faiss/loader.py:39: in <module>
    from .swigfaiss import *
env/lib/python3.6/site-packages/faiss/swigfaiss.py:13: in <module>
    from . import _swigfaiss
E   ImportError: dlopen: cannot load any more object with static TLS

Seems related to other issues, but I’m still not sure of the solution: https://github.com/facebookresearch/faiss/issues/866 https://github.com/facebookresearch/faiss/issues?q=is%3Aissue+swigfaiss_avx2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
yby9212commented, Mar 4, 2022

try

cd your_python_path/site-packages/faiss
ln -s swigfaiss.py swigfaiss_avx2.py
1reaction
ckaldcommented, Sep 26, 2022

Yes, avx2 extenstion is not included in the wheel for maximum compatibility. You can safely ignore

Which basically means that faiss will run up to 10 times slower. A couple of years ago we discovered that our production server was not running faiss with AVX2 and had to work our way through debugging faiss and compiling specific avx2-enabled wheels: https://github.com/ckald/faiss-wheels-prophy/ (1.6.5)

I think that this almost silent behavior is very bad 🤷

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Installing Faiss on Lambda Stack - Stack Overflow
I want to install Faiss-GPU on Lambda Stack by conda install -c pytorch ... No such file or directory ModuleNotFoundError: No module named...
Read more >
I have an existing linux python project that uses faiss - Facebook
com/facebookresearch/faiss/blob/master/INSTALL. md. I need to run this python program in Windows but I'm getting the error: No module named '_swigfaiss'
Read more >
ModuleNotFoundError: No module named 'faiss' - RoseIndia.Net
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'faiss' How to remove the ModuleNotFou.
Read more >
attributeerror: module 'faiss._swigfaiss' has no attribute ...
C++; [1 ] Python. Reproduction instructions. import faiss indexFlatL2 = faiss.IndexFlatL2(64). I get this error AttributeError: module 'faiss' has no attribute ...
Read more >
No module named swigfaiss_bitcarmanlee的博客
openblas这种东西,那必然就是与科学计算有关系了… macos系统上,可以使用如下命令安装: #cpu 版本conda install faiss-cpu -c pytorch # GPU 版本conda ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found