yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.24k stars 114 forks source link

Error installing python bindings #87

Closed zubairahmed-ai closed 3 years ago

zubairahmed-ai commented 3 years ago

Hi

I managed to install NGT but I am unable to install python bindings (which I believe are required) I am following the steps to install bindings from here

I am getting the below error

Failed to build ngt
Installing collected packages: numpy, pybind11, ngt
    Running setup.py install for ngt ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r3ms32jz/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-r3ms32jz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bkt6fq2b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/ngt
         cwd: /tmp/pip-req-build-r3ms32jz/
    Complete output (18 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/ngt
    copying ngt/base.py -> build/lib.linux-x86_64-3.6/ngt
    copying ngt/__init__.py -> build/lib.linux-x86_64-3.6/ngt
    running build_ext
    building 'ngtpy' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/usr/local/include/python3.6 -I/home/server/.local/include/python3.6m -I/usr/include/python3.6m -c src/ngtpy.cpp -o build/temp.linux-x86_64-3.6/src/ngtpy.o -std=c++11 -Ofast -fopenmp -march=native -lrt -DNDEBUG
    src/ngtpy.cpp:21:10: fatal error: pybind11/pybind11.h: No such file or directory
     #include <pybind11/pybind11.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r3ms32jz/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-r3ms32jz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bkt6fq2b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/ngt Check the logs for full command output.
masajiro commented 3 years ago

HI. I have fixed this problem in the latest commit. Please use the latest.

zubairahmed-ai commented 3 years ago

I did those changes manually in setup.py rebuilt and now its installed successfully. Thank you