Skip to content
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

ModuleNotFoundError: No module named 'faiss' on windows #1699

Closed
abdulwajid725 opened this issue Feb 19, 2021 · 10 comments
Closed

ModuleNotFoundError: No module named 'faiss' on windows #1699

abdulwajid725 opened this issue Feb 19, 2021 · 10 comments
Labels

Comments

@abdulwajid725
Copy link

Summary

I installed Faiss using the following command in my conda environment --> "conda install -c pytorch faiss-cpu"

Windows 10
Running on CPU
Interface - python

List of packages installed :
+conda-forge/win-64::faiss-1.7.0-py37h59bcff0_2_cpu
+conda-forge/win-64::faiss-cpu-1.7.0-hf9c7e24_2
+conda-forge/win-64::libfaiss-1.7.0-he82878b_2_cpu

Importing Faiss gives "ModuleNotFoundError: No module named 'faiss'"
Looked into previous solutions for this issue but no success.

@beauby
Copy link
Contributor

beauby commented Feb 19, 2021

It seems you have packages installed from conda-forge, yet you mention installing from the pytorch channel. Please try installing in a fresh conda environment:

conda create -n faiss_env -c pytorch python=3.8 faiss-cpu
conda activate faiss_env

@mdouze mdouze added the install label Feb 19, 2021
@NeverInAsh
Copy link

Hi I am installing in a new environment. But i still face this issue.
I am attaching the image of my packages in the new environment.

image

@beauby
Copy link
Contributor

beauby commented Mar 5, 2021

@NeverInAsh You have both faiss (from pypi) and faiss-cpu(from conda) installed. This is almost a guarantee for conflicts.

@beauby beauby closed this as completed Mar 5, 2021
@NeverInAsh
Copy link

@beauby Sorry I didn't see this comment. But this is something that is getting installed automatically. Why is this happening ?

@beauby
Copy link
Contributor

beauby commented Mar 5, 2021

@NeverInAsh Not sure about your setup, but try pip uninstall faiss.

@NeverInAsh
Copy link

It is not finding faiss package

image

@DeepTecher
Copy link

i guess you need uninstall faiss-cpu

you can grep to find faiss package:

pip list | grep faiss

@tginart
Copy link

tginart commented Nov 17, 2021

Hi all,

Having a similar issue:

(env) tginart@machine:~$ conda list | grep 'faiss'
faiss-gpu                 1.7.1           py3.7_h080d439_1_cuda10.2    pytorch
libfaiss                  1.7.1           h4fe19ad_1_cuda10.2    pytorch

But I still cannot import:

Python 3.7.4 (default, Aug 13 2019, 20:35:49) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faiss
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'faiss'

Any suggestions? Thanks!

@jpm1989
Copy link

jpm1989 commented Dec 28, 2022

Try to install "jupyter notebook" or "jupyter lab" in that environment. After that try to "import faiss".
e.g. (my_env) c:\Users\xyz "here install jupyter notebook"
then open that notebook,
then "import faiss"

Let me know if this resolves your query

@hemangjoshi37a
Copy link

pip install faiss-cpu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants