Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed building wheel for annoy (Ubuntu 20.04) #574

Closed
semskurto opened this issue Sep 19, 2021 · 2 comments
Closed

Failed building wheel for annoy (Ubuntu 20.04) #574

semskurto opened this issue Sep 19, 2021 · 2 comments

Comments

@semskurto
Copy link

semskurto commented Sep 19, 2021

Hi,
Annoy package installation fails. Where am I doing wrong? I would be glad if you help.
My computer using Ubuntu 20.04.3 LTS ( Python 3.8.10, gcc 9.3.0, g++ is not installed )

~$ pip install annoy
Collecting annoy
  Using cached annoy-1.17.0.tar.gz (646 kB)
Building wheels for collected packages: annoy
  Building wheel for annoy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pizdjmsj/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pizdjmsj/annoy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-wlyztju2
       cwd: /tmp/pip-install-pizdjmsj/annoy/
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/annoy
  copying annoy/__init__.py -> build/lib.linux-x86_64-3.8/annoy
  running build_ext
  building 'annoy.annoylib' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c src/annoymodule.cc -o build/temp.linux-x86_64-3.8/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
  x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-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: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pizdjmsj/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pizdjmsj/annoy/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-_cmv8gav/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/sems/.local/include/python3.8/annoy
         cwd: /tmp/pip-install-pizdjmsj/annoy/
    Complete output (15 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/annoy
    copying annoy/__init__.py -> build/lib.linux-x86_64-3.8/annoy
    running build_ext
    building 'annoy.annoylib' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c src/annoymodule.cc -o build/temp.linux-x86_64-3.8/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
    x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
    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-install-pizdjmsj/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pizdjmsj/annoy/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-_cmv8gav/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/sems/.local/include/python3.8/annoy Check the logs for full command output.

Also I try Python 3.7.12:

~$ python3.7 -m pip install annoy
Collecting annoy
  Using cached annoy-1.17.0.tar.gz (646 kB)
Building wheels for collected packages: annoy
  Building wheel for annoy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-epr5kyyw/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-epr5kyyw/annoy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-eq_qf03y
       cwd: /tmp/pip-install-epr5kyyw/annoy/
  Complete output (15 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
  running build_ext
  building 'annoy.annoylib' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-w3mY2c/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-w3mY2c/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/annoymodule.cc -o build/temp.linux-x86_64-3.7/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
  x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-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: /usr/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-epr5kyyw/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-epr5kyyw/annoy/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-d_v5z4hz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/sems/.local/include/python3.7m/annoy
         cwd: /tmp/pip-install-epr5kyyw/annoy/
    Complete output (15 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
    running build_ext
    building 'annoy.annoylib' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-w3mY2c/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-w3mY2c/python3.7-3.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/annoymodule.cc -o build/temp.linux-x86_64-3.7/src/annoymodule.o -D_CRT_SECURE_NO_WARNINGS -march=native -O3 -ffast-math -fno-associative-math -DANNOYLIB_MULTITHREADED_BUILD -std=c++14
    x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
    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.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-epr5kyyw/annoy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-epr5kyyw/annoy/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-d_v5z4hz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/sems/.local/include/python3.7m/annoy Check the logs for full command output.
@semskurto
Copy link
Author

semskurto commented Sep 20, 2021

I'm also running into a problem installing g++. This could be the source of the problem. I would be glad if you share your thoughts on this.

~$ sudo apt install g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 g++ : Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

@erikbern
Copy link
Collaborator

These issues seem unrelated to Annoy? Looks like you're having issue installing GCC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants