kyamagu / faiss-wheels

Unofficial faiss wheel builder
MIT License
275 stars 35 forks source link

Faiss-cpu requires numpy, but numpy not installed as a dependency of faiss-cpu #78

Closed geoffreyblake closed 11 months ago

geoffreyblake commented 1 year ago

Describe the bug Doing a simple pip install of faiss-cpu and then importing the library into python will fail because it depends on numpy.

To Reproduce Describe the steps to reproduce the behavior:

python3 -m pip install faiss-cpu
python3 "import faiss"

Sees the following error

Collecting faiss-cpu
  Downloading faiss_cpu-1.7.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 24.8 MB/s eta 0:00:00
Installing collected packages: faiss-cpu
Successfully installed faiss-cpu-1.7.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Traceback (most recent call last):
  File "/io/test-script.py", line 1, in <module>
    import faiss
  File "/usr/local/lib/python3.10/dist-packages/faiss/__init__.py", line 11, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Expected behavior Installing faiss-cpu should pull in all its dependencies automatically.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.