-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Faiss import error when run in virtualenv by using own built Faiss-python #866
Comments
Could you paste the output of |
|
And the output of |
I guess this might be related to egg file, when I do
after I unzip the egg file, I don't see error as below
|
Same thing happened to me. |
这个问题好麻烦 |
Same problem here. |
@HoweChen @WIll-Xu35 Please paste your generated |
@beauby I met this problem when using pytorch docker environment, which has conda environment and it was really a mess. I gave up on that environment and installed faiss without docker or conda. The installation was successful. |
Same thing here. Compiled from source with anaconda virtual env. My makefile.inc is as below.
|
Found the solution for me! Just unzip the egg file! And then a new folder called |
where can I get the egg file? Could you share me the link. |
@beauby I am facing the same issue:
@XinliYu could you please explain more on what you did? |
your python dist-packages, such as mine : /usr/local/lib/python3.5/dist-packages |
exporting the path to _swigfaiss in the venv's activate script worked for me. Just add this to the end of your activate script: Then deactivate and activate again and it should work. |
No activity, closing. |
Solution: unzip the .egg file create the folder "faiss-1.6.1-py3.5.egg" or whatever your error while import python3 comes up. then check with import faiss @mdouze |
My case, the egg was already extracted. this one may resolve your error.
|
for me, it is numpy version problem. I have upgraded numpy version from 1.13.1 to 1.18.2 and it works. Be sure the old version numpy is totally removed, I have uninstalled 1.18.2 numpy and find that numpy is still available in ipython, then I found that 1.18.2 is not the only numpy version installed in my server. |
Just install three things in the following order and your problem Is solved pip3 install faiss |
If you have I had installed faiss-cpu using: |
thanks! |
The unzip strategy from @XinliYu and @deimsdeutsch work great. An alternative to changing the permissions of the egg file is to use python-pip instead:
rather than using the current install directions from step 3 (see below),
|
Summary
I have built faiss-core and faiss-python by myself. I installed python into my local virtual env and try to import faiss and I got an error, checked egg file, it does have _swigfaiss.so inside. I checked conda swigfaiss.py, it's still using old swig_import_helper, not sure if caused by this you remove it by using swig create python/swigfaiss.py as follows:
7f5b22b#diff-8cf6167d58ce775a08acafcfe6f40966
Platform
OS: centos 7
Faiss version: 1.5.2
Faiss compilation options:
Running on:
Interface:
Reproduction instructions
The text was updated successfully, but these errors were encountered: