hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

install

Open antxiaojun opened this issue 7 years ago • 4 comments

antxiaojun avatar Dec 20 '18 03:12 antxiaojun

how to install

antxiaojun avatar Dec 20 '18 05:12 antxiaojun

how to install

apt-get install -y python-setuptools python-pip pip3 install pybind11 numpy setuptools cd python_bindings python3 setup.py install

RyanLiGod avatar Dec 21 '18 04:12 RyanLiGod

I did this and see logs below. However, when I import the import, it complains that module does not exist.

Installed /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/hnswlib-0.2-py3.6-linux-x86_64.egg
Processing dependencies for hnswlib==0.2
Searching for numpy==1.14.5
Best match: numpy 1.14.5
Adding numpy 1.14.5 to easy-install.pth file

Using /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages
Searching for pybind11==2.2.4
Best match: pybind11 2.2.4
Adding pybind11 2.2.4 to easy-install.pth file

Using /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages
Finished processing dependencies for hnswlib==0.2
import hnswlib

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-17-5b872521c582> in <module>()
----> 1 import hnswlib

ModuleNotFoundError: No module named 'hnswlib

Kindly help. Thanks

OElesin avatar Dec 29 '18 13:12 OElesin

Found that the module was named with my Linux version on Mac likewise the __init__.py was also missing the module's root directory.

After changing the name and adding the __init__.py file, it now works.

OElesin avatar Dec 30 '18 15:12 OElesin