unable to execute 'gcc': No such file or directory - gcc

Is there other way to install gcc on centos apart from yum .
As in my case yum is not supported as it is proprietary.
Possibly to install gcc using wget,curl,rpm ?
My tox test failed with error
"unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1"
Error :
Running setup.py install for netifaces: started
Running setup.py install for netifaces: finished with status 'error'
Complete output from command /share/CACHEDEV1_DATA/.qpkg/QKuryr/rootfs/opt/kuryr-libnetwork/.tox/genconfig/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/share/CACHEDEV1_DATA/.qpkg/QKuryr/rootfs/opt/kuryr-libnetwork/pip-install-qukyvv5u/netifaces/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /share/CACHEDEV1_DATA/.qpkg/QKuryr/rootfs/opt/kuryr-libnetwork/pip-record-0gq4z4z1/install-record.txt --single-version-externally-managed --compile --install-headers /share/CACHEDEV1_DATA/.qpkg/QKuryr/rootfs/opt/kuryr-libnetwork/.tox/genconfig/include/site/python3.5/netifaces:
running install
running build
running build_ext
checking for getifaddrs...not found.
checking for getnameinfo...not found.
checking for socket IOCTLs...not found.
checking for optional header files...none found.
checking whether struct sockaddr has a length field...no.
checking which sockaddr_xxx structs are defined...none!
checking for routing socket support...no.
checking for sysctl(CTL_NET...) support...no.
checking for netlink support...no.
building 'netifaces' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNETIFACES_VERSION=0.10.6 -I/share/CACHEDEV1_DATA/.qpkg/Python3/src/include/python3.5m -c netifaces.c -o build/temp.linux-x86_64-3.5/netifaces.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

Related

Not able to install Pycairo while deploying app using Heroku

I'm trying to deploy a python app using Heroku, but I'm not able to install pycairo, which is added to requirements.txt file. I have used https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/apt.tgz build-package to install required apt packages.
When I tried to install this package in Heroku bash using pip, it returned the same error.
Building wheel for pycairo (setup.py): started
Building wheel for pycairo (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6rkzsy5d/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6rkzsy5d/pycairo/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-0eopb8bo
cwd: /tmp/pip-install-6rkzsy5d/pycairo/
Complete output (35 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/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
running build_ext
building 'cairo._cairo' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/cairo
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=19 -DPYCAIRO_VERSION_MICRO=1 -I/tmp/build_5896cd7c39526a1767b861fb4950464e/.apt/usr/include/cairo -I/tmp/build_5896cd7c39526a1767b861fb4950464e/.apt/usr/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/app/.heroku/python/include/python3.8 -c cairo/device.c -o build/temp.linux-x86_64-3.8/cairo/device.o -Wall -Warray-bounds -Wcast-align -Wconversion -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-format-attribute -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wswitch-default -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-command-line-argument -fno-strict-aliasing -fvisibility=hidden -std=c99
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6rkzsy5d/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6rkzsy5d/pycairo/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-lbe5cexs/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.8/pycairo Check the logs for full command output.
! Push rejected, failed to compile Python app.
! Push failed
Please don't link the archive file (.tgz) of the buildpack, but its homepage from here.
In the error output you posted, the build_ext function of the Python Setuptools build system fails to build cairo. In particular, the gcc compiler tells you that the ld linker failed. I guess it's because the script in the buildpack didn't link the cairo library.
I think you have 2 options:
Modify the Heroku buildpack and figure out how to install the cairo C library and link it when Pycairo runs the build_ext function.
Create a Dockerimage that includes the conda package manager (I would start from docker-miniconda) and install Pycairo as a conda recipe.
Option 2 should be far easier.
See also my other answer here.

error: command 'gcc' failed with exit status 1 fatal error: 'vector' file not found

I ran pip install annoy and got the following error:
Collecting annoy
Using cached https://files.pythonhosted.org/packages/b5/28/f8ce7400344090bb5cfa1c9fae3fdb03b9438db082d458686442633d82a3/annoy-1.15.0.tar.gz
Building wheels for collected packages: annoy
Running setup.py bdist_wheel for annoy ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/pip-build-h3hirwtn/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 /var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/tmpdqliidvopip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-3.6
creating build/lib.macosx-10.6-x86_64-3.6/annoy
copying annoy/__init__.py -> build/lib.macosx-10.6-x86_64-3.6/annoy
running build_ext
building 'annoy.annoylib' extension
creating build/temp.macosx-10.6-x86_64-3.6
creating build/temp.macosx-10.6-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.6m -c src/annoymodule.cc -o build/temp.macosx-10.6-x86_64-3.6/src/annoymodule.o -O3 -ffast-math -fno-associative-math -march=native
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from src/annoymodule.cc:15:
src/annoylib.h:49:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
From reading other stackoverflow answers, I should compile with g++ rather than gcc? How do I do that?
I should compile with g++ rather than gcc : visibly yes, #include <vector> is typically C++, not C
The way to install g++ depend on the platform/OS you use

pip install sanic : command 'gcc' terminated by signal 11

So I am trying to install sanic on my mac os yosemite but for some reason everytime I try to install it, it just returns this error.
building 'ujson' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/python
creating build/temp.macosx-10.9-x86_64-3.6/lib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./python -I./lib -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c ./python/ujson.c -o build/temp.macosx-10.9-x86_64-3.6/./python/ujson.o -D_GNU_SOURCE
error: command 'gcc' terminated by signal 11
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/f8/vtw38lxs63d18dj7sztkyp9w0000gn/T/pip-install-74t39yin/ujson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/f8/vtw38lxs63d18dj7sztkyp9w0000gn/T/pip-record-0hl9eodf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/f8/vtw38lxs63d18dj7sztkyp9w0000gn/T/pip-install-74t39yin/ujson/
It also happens when I try to install vibora (another asynchronous web framework) or eventlet for flask websocket

PIL installation error on Mac OS Maverics inside virtual env

I am trying to install PIL inside virtual as below
pip intall PIL
And i got the below error
Downloading/unpacking PIL
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imagingft' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imagingft' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7 failed with error code 1 in /Users/user/.virtualenvs/proj/build/PIL
So how to fix it and can some one let me know why it is throwing me an error on my new macbook air ?
I suggest you try Pillow, the fork of PIL. I've not tried in a virtual machine but on Mac OS X you can do this:
brew install libtiff libjpeg webp little-cms2
pip install Pillow
Full details here: http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation

Ansible Installation -clang: error: unknown argument: '-mno-fused-madd'

So, I've found some other clang error's on here that appear to be somewhat similar, however, the fixes aren't applicable to my situation.
I'm using OSX Mavericks and we're trying to get Ansible installed.
I got pip to install correctly, but when I try to install Ansible, I get this clang error.
We thought, at first, that it might be a version issue, so I re-installed gcc46 after having this same error with gcc49, but I'm still getting the error.
Does anyone know how to fix this?
My complete error report from the pip.log log file is as follows:
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir /private/tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Thanks to anyone who can help me with this. We've spent the past several hours trying to get this to install, and it's starting to get fairly frustrating.
I ran into the same problem recently while trying to install a different package.
Setting the following environment variables prior to installing with pip resolved the issue for me:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
If you're installing via sudo, don't forget to use "sudo -E" so that your environment variables propagate through sudo.
If that doesn't work for you, try the following command instead:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install ansible
Alternatively, as yet another potential solution, you can attempt to recompile a fresh version of python using Homebrew.
See this question for more information.
Hope this helps!
For the beginners, who read and tried the answer above but still failed (me):
sudo su -
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install ansible
exit
You need to run those export commands as the root user. The previous answer clearly states this, but what it actually meant didn't translate to me as a terminal novice. What sudo su - does is basically switch to the root user. Then any commands you type are executed as root, and this thing works.
This finally let me get Ansible running on OSX 10.9.2 after a lot of head-banging.
Solution reference: https://github.com/ansible/ansible/issues/7146#issuecomment-41239561
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future cc .....
or
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"

Resources