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

Intallation fails for python 3.7/3.8: compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- #155

Closed
RAJKRIS opened this issue Jul 18, 2020 · 4 comments

Comments

@RAJKRIS
Copy link

RAJKRIS commented Jul 18, 2020

Tried to install librabbitmq with python3.7/3.8.
pip install librabbitmq
Getting the below traceback:

ERROR: Command errored out with exit status 1:
command: /home/rajkris/virtuals/demo/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f529prvp/librabbitmq/setup.py'"'"'; file='"'"'/tmp/pip-install-f529prvp/librabbitmq/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-5w_cowci/install-record.txt --single-version-externally-managed --compile --install-headers /home/rajkris/virtuals/demo/include/site/python3.7/librabbitmq
cwd: /tmp/pip-install-f529prvp/librabbitmq/
Complete output (33 lines):
/tmp/pip-install-f529prvp/librabbitmq/setup.py:167: DeprecationWarning: 'U' mode is deprecated
long_description = open(os.path.join(BASE_PATH, 'README.rst'), 'U').read()
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/librabbitmq
copying librabbitmq/init.py -> build/lib.linux-x86_64-3.7/librabbitmq
creating build/lib.linux-x86_64-3.7/funtests
copying funtests/config.py -> build/lib.linux-x86_64-3.7/funtests
copying funtests/setup.py -> build/lib.linux-x86_64-3.7/funtests
copying funtests/init.py -> build/lib.linux-x86_64-3.7/funtests
copying funtests/disabled_basic_get_leak.py -> build/lib.linux-x86_64-3.7/funtests
creating build/lib.linux-x86_64-3.7/funtests/tests
copying funtests/tests/init.py -> build/lib.linux-x86_64-3.7/funtests/tests
copying funtests/tests/test_channel_errors.py -> build/lib.linux-x86_64-3.7/funtests/tests
running build_ext
building '_librabbitmq' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/tmp
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq/Modules
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq/Modules/_librabbitmq
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq/rabbitmq-c
creating build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq/rabbitmq-c/librabbitmq
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-ZW5_z6/python3.7-3.7.8=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-ZW5_z6/python3.7-3.7.8=. -fstack-protector-strong -Wformat -Werror=format-security -DHAVE_CONFIG_H -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-install-f529prvp/librabbitmq/rabbitmq-c/librabbitmq -I/tmp/pip-install-f529prvp/librabbitmq/rabbitmq-c -I/home/rajkris/virtuals/demo/include -I/usr/include/python3.7m -c /tmp/pip-install-f529prvp/librabbitmq/Modules/_librabbitmq/connection.c -o build/temp.linux-x86_64-3.7/tmp/pip-install-f529prvp/librabbitmq/Modules/_librabbitmq/connection.o
In file included from /tmp/pip-install-f529prvp/librabbitmq/Modules/_librabbitmq/connection.c:11:0:
/tmp/pip-install-f529prvp/librabbitmq/Modules/_librabbitmq/connection.h:5:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/rajkris/virtuals/demo/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f529prvp/librabbitmq/setup.py'"'"'; file='"'"'/tmp/pip-install-f529prvp/librabbitmq/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-5w_cowci/install-record.txt --single-version-externally-managed --compile --install-headers /home/rajkris/virtuals/demo/include/site/python3.7/librabbitmq Check the logs for full command output.

However the installation works for python3.6.

@thedrow
Copy link
Member

thedrow commented Jul 19, 2020

It sounds like something is wrong with your environment.
Can you try to reproduce this in Docker for example?

@nvwlspls
Copy link

This is what solved this problem for me:
(Ubuntu 18.04)
sudo apt-get install python3.8-dev

@auvipy
Copy link
Member

auvipy commented Aug 21, 2020

avoid using this package. py-amqp is way more stable & speedier with cythonized code

@thedrow
Copy link
Member

thedrow commented Sep 1, 2020

This is what solved this problem for me:
(Ubuntu 18.04)
sudo apt-get install python3.8-dev

That's probably the issue.

@thedrow thedrow closed this as completed Sep 1, 2020
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

4 participants