kyamagu / faiss-wheels

Unofficial faiss wheel builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation fails in clean python env (numpy requirement before installation)

tholor opened this issue · comments

Hey,

First of all: Thanks for maintaining the unofficial PyPI packages!

I noticed that with the latest 1.6.4. the installation via pip fails if you don't run the install from an env already having numpy installed. This is particularly problematic in fresh deployments / dockerfiles.
I see that you are using numpy here in setup.py. From my perspective, there should ideally be no external packages needed before the installation. Could you maybe move back to standard python modules there?

INCLUDE_DIRS = [np.get_include(), FAISS_INCLUDE]

Error message:

Collecting faiss-cpu (from -r requirements.txt (line 19))
  Downloading https://files.pythonhosted.org/packages/5d/3d/8ab01d4421c3889e8d3379661f5453ebbbec209f91ee4d067af13ca18a13/faiss-cpu-1.6.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-iiioulxg/faiss-cpu/setup.py", line 6, in <module>
        import numpy as np
    ModuleNotFoundError: No module named 'numpy'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-iiioulxg/faiss-cpu/
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1

Alright, this needs to be worked around by, perhaps delayed np.get_include() evaluation.

setup_requires=['numpy'],

I am having this same error with pip install faiss-gpu-1.7.1. I have the numpy installed both in root env and my active venv. What could be the problem?

We do not provide faiss-gpu on PyPI anymore. Check the assets of the following release.
https://github.com/kyamagu/faiss-wheels/releases/tag/v1.7.3