ubuntu 20.04 LTS 上面提示无法 build python 接口的警告
./configure
…
checking for numpy headers path… Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named numpy
not found
configure: WARNING: You won’t be able to build the python interface.
这是因为 ubuntu 20.04 逐步放弃 python 2 的支持,系统的源已经不再提供 pip 命令了
两个办法:
手动安装 python2-pip
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py
通过 pip 安装 numpy 包,使用清华大学的源
sudo pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
再次运行 configure,不再出现警告
让 faiss 为 python 3 build 接口
./configure --with-python=/usr/bin/python3