error: command 'gcc' failed with exit status 1 error - python

Hey there I'm currently trying to help a host resolve an issue. The issue we getting is error: command 'gcc' failed with exit status 1 we have tried installing the gcc compiler apt-get install python3-dev however it seems to be already installed.
Error:
I/usr/include/python3.7m -c multidict/_multidict.c -o build/temp.linux-x86_64-3.7/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-bu65o7vu/multidict/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-c0gfiuzu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-bu65o7vu/multidict/
You are using pip version 19.0.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Seán's Discord Bot:~/$
Weirdest t part is that gcc is installed
They use a container based system (docker) and need to find a way to implement it per-container.
Help would be much appreciated.

Related

Installing chatterbot but getting "ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly"

I'm trying to install chatterbot on macOS with
python3 -m pip install chatterbot
and every time I get the same error during the step "Installing build dependencies ... /"
ERROR: Failed building wheel for spacy
Running setup.py clean for spacy
Failed to build spacy
ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly
Can someone please help?
Installing collected packages: spacy, chatterbot
Running setup.py install for spacy ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/spacy
copying spacy/lemmatizer.py -> build/lib.macosx-10.9-x86_64-3.7/spacy
running build_ext
building 'spacy._align' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/spacy
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c spacy/_align.cpp -o build/temp.macosx-10.9-x86_64-3.7/spacy/_align.o -O2 -Wno-strict-prototypes -Wno-unused-function -stdlib=libc++
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/
You could try python3 -m pip install --no-binary spacy chatterbot, which should tell pip to not build the wheel
Alternately python3 -m pip install --no-use-pep517 chatterbot.
I had the same problem while installing kivy through command prompt.
If you use Pycharm then there is an easy way to avoid these problems.
Open Pycharm-->GoTo Files-->Settings-->Project-->Python Interpreter--> + sign-->then search for what you want to install. Check the version which works for you and install it.
If you get an error then try and install other versions of it. That would solve the issue.
Try installing the python-dev version.
For python3.7
sudo apt-get install python3.7-dev
For python3.6
sudo apt-get install python3.6-dev
In one of the scenarios where if you are using Anaconda, then you have to install using this command:
conda install -c conda-forge spacy, hope this helps !!
I had this issue with MacOS for a different package. I found this warning in the log:
WARNING: Building wheel for bottleneck failed: [Errno 13] Permission denied: '/Users/avi/Library/Caches/pip/wheels/87'
Then I gave my user access to the pip/wheels directory and then the installation worked.
Easy, try to run this:
pip install pep517
And then try to install again
python3 -m pip install chatterbot

Installing pyodbc failed on Linux

I just run this command:
sudo pip install pyodbc
then I get below message and error:
steven81#PythonWEBVM:~$ sudo pip install pyodbc
The directory '/home/steven81/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/steven81/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyodbc
Downloading https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz (215kB)
100% |████████████████████████████████| 225kB 13.5MB/s
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NR7ytY/pyodbc/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-voJYBN/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python2.7 -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-2.7/src/pyodbcmodule.o -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/pyodbcmodule.cpp:11:0:
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NR7ytY/pyodbc/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-voJYBN/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NR7ytY/pyodbc/
I saw there is an error:
command 'x86_64-linux-gnu-gcc' failed with exit status 1
then I search in on google, it asked to run this:
sudo apt-get install python-dev
so, I run this but get below message:
steven81#PythonWEBVM:~$ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.12-1~16.04).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
so what's the problem and how to install pyodbc correctlly?
For anyone looking for the pyodbc install to connect to SQLServer from Linux(ubuntu).
sudo apt-get install unixodbc-dev
sudo apt-get install python3-dev
python3 -m pip install pyodbc

pycurl link error after upgrade from Yosemite to High Sierra

I just upgraded from Yosemite to High Sierra, which worked quite well, with the only exception that I have a bug in pycurl.
import pycurl
ImportError: No module named pycurl
so I did
pip uninstall pycurl
and
pip install --no-cache-dir --compile pycurl
but now it results in a clang error
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-2.7/src/docstrings.o build/temp.macosx-10.10-x86_64-2.7/src/easy.o build/temp.macosx-10.10-x86_64-2.7/src/module.o build/temp.macosx-10.10-x86_64-2.7/src/multi.o build/temp.macosx-10.10-x86_64-2.7/src/oscompat.o build/temp.macosx-10.10-x86_64-2.7/src/pythoncompat.o build/temp.macosx-10.10-x86_64-2.7/src/share.o build/temp.macosx-10.10-x86_64-2.7/src/stringcompat.o build/temp.macosx-10.10-x86_64-2.7/src/threadsupport.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lssl3 -lcurl -o build/lib.macosx-10.10-x86_64-2.7/pycurl.so
ld: library not found for -lssl3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-build-1rx5q1/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-MkzYNt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-build-1rx5q1/pycurl/
any idea what is going on here?
this fixed it...
export PYCURL_SSL_LIBRARY=openssl

Install big float on mac OS X

I am trying to install big float on OS X but i am encountering multiple issues.
I have installed amp without any problem, but when I have tried to install mpfr I got this error:
Warning: mpfr-3.1.5 already installed, it's just not linked.
What does this mean? (I am using Homebrew).
Then, obviously, if I try to install bigfloat it doesn't work and i get this error:
Collecting bigfloat
Downloading bigfloat-0.3.0.tar.gz (216kB)
100% |████████████████████████████████| 225kB 1.6MB/s
Installing collected packages: bigfloat
Running setup.py install for bigfloat ... error
Complete output from command /Users/name/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile:
running build_ext
building 'mpfr' extension
creating build
creating build/temp.macosx-10.7-x86_64-2.7
gcc -fno-strict-aliasing -I/Users/name/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/Users/name/anaconda2/include/python2.7 -c mpfr.c -o build/temp.macosx-10.7-x86_64-2.7/mpfr.o
In file included from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/syslimits.h:7:0,
from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:34,
from /Users/name/anaconda2/include/python2.7/Python.h:19,
from mpfr.c:16:
/usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users//anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-VCyOBn/bigfloat/
You must install python-devel
In OS X try to uninstall and install again:
brew uninstall python
brew install python
Also according to this issue, Osx GCC (which is just a symlink to clang) doesn't ship with OpenMP support out of the box. You can install GCC with OpenMP.
brew install gcc --without-multilib

Python pip cannot install zbarlight: error: command 'gcc' failed with exit status 1

First of all I installed Python 3.5.1:
yum -y install zbar gcc gcc-c++ kernel-devel
./configure --enable-shared --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
make && make install
Tried to install zbarlight pypi package but failed:
src/zbarlight/_zbarlight.c:137: error: ‘ZBAR_QRCODE’ undeclared (first use in this function)
src/zbarlight/_zbarlight.c:138: error: ‘ZBAR_CODE128’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur77y560/zbarlight/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-hoalto9f-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ur77y560/zbarlight/
How do I fix that? I tried pip3.5 -v but doesn't show any more meaningful error.
Had to install
yum install zbar-devel

Categories