spotify / annoy

Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Apache License 2.0
13.1k stars 1.16k forks source link

Annoy - Installation #607

Open Sayyam-Shah opened 2 years ago

Sayyam-Shah commented 2 years ago

Hello @erikbern,

Thank you for the amazing tool.

I am trying to install a bioinformatics tool that uses annoy called pycistopic. However, I get the below error.

Building wheels for collected packages: pycisTopic, annoy
Building wheel for pycisTopic (setup.py) ... done
Created wheel for pycisTopic: filename=pycisTopic-1.0.2.dev9+gaf3977c-py3-none-any.whl size=93786 sha256=7fd73da5c063af0c55166c4226b65cbd0d604cfc51d8519f93886812f4bbe8ff
Stored in directory: /tmp/pip-ephem-wheel-cache-n9q03_td/wheels/62/64/82/580e6ee56bd55c662eae26c715f7a5e51d1c149c0775b38171
Building wheel for annoy (setup.py) ... error
ERROR: Command errored out with exit status 1:

ERROR: Failed building wheel for annoy
Running setup.py clean for annoy
Successfully built pycisTopic
Failed to build annoy
Installing collected packages: annoy, tmtoolkit, scrublet, scanorama, python-Levenshtein, python-igraph, pyfasta, pyBigWig, polars, papermill, macs2, lxml, lda, ipympl, gensim, bs4, bbknn, pycisTopic
Running setup.py install for annoy ... error
ERROR: Command errored out with exit status 1:

I then tried installing annoy separately and got the below error.

Using cached annoy-1.17.1.tar.gz (647 kB)
Building wheels for collected packages: annoy
  Building wheel for annoy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /cluster/tools/software/centos7/python/3.7.2/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-muae78vy
       cwd: /tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/annoy
  copying annoy/__init__.py -> build/lib.linux-x86_64-3.7/annoy
  copying annoy/__init__.pyi -> build/lib.linux-x86_64-3.7/annoy
  copying annoy/py.typed -> build/lib.linux-x86_64-3.7/annoy
  running build_ext
  building 'annoy.annoylib' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  gcc -pthread -B /cluster/tools/software/centos7/python/3.7.2/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/cluster/tools/software/centos7/python/3.7.2/include/python3.7m -c src/annoymodule.cc -o build/temp.linux-x86_64-3.7/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -fpermissive -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
  gcc: error: unrecognized command line option ‘-std=c++14’
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for annoy
  Running setup.py clean for annoy
Failed to build annoy
Installing collected packages: annoy
    Running setup.py install for annoy ... error
    ERROR: Command errored out with exit status 1:
     command: /cluster/tools/software/centos7/python/3.7.2/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ml7it_46/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /cluster/home/.local/include/python3.7m/annoy
         cwd: /tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/annoy
    copying annoy/__init__.py -> build/lib.linux-x86_64-3.7/annoy
    copying annoy/__init__.pyi -> build/lib.linux-x86_64-3.7/annoy
    copying annoy/py.typed -> build/lib.linux-x86_64-3.7/annoy
    running build_ext
    building 'annoy.annoylib' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    gcc -pthread -B /cluster/tools/software/centos7/python/3.7.2/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/cluster/tools/software/centos7/python/3.7.2/include/python3.7m -c src/annoymodule.cc -o build/temp.linux-x86_64-3.7/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -fpermissive -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
    gcc: error: unrecognized command line option ‘-std=c++14’
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /cluster/tools/software/centos7/python/3.7.2/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ea1pfbc5/annoy_1f5f0cb1d6cb495f9b92792e629a7812/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ml7it_46/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /cluster/home/.local/include/python3.7m/annoy Check the logs for full command output

Why may I be getting problems when installing the package? May you please help me debug this? I am installing it on an HPC cluster using pip install --user annoy.

erikbern commented 2 years ago

It looks like you have an old version of GCC. Are you able to upgrade?

Sayyam-Shah commented 2 years ago

Thank you so much! I emailed the manager of the HPC cluster and updated the GCC version.