I'm trying to install a tool through pip3 onto my Mac but I get the following error:
compilation terminated. error: command 'gcc' failed with exit status 1**
I've noticed that others have this issue since Mohave and suggest changing the location to where the headers point to, however with the Catalina update the location changed to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
, and after trying the CPATH=
and C_INCLUDE_PATH=
methods I am still stuck. Has anyone come across this issue also?
Full Error:
**ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-install-5ud0hb2z/cchardet/setup.py'"'"'; __file__='"'"'/private/var/folders/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-install-5ud0hb2z/cchardet/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/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-record-x2sb36vg/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-install-5ud0hb2z/cchardet/
Complete output (24 lines):
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/cchardet
copying src/cchardet/version.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet
copying src/cchardet/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet
running build_ext
building 'cchardet._cchardet' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/src
creating build/temp.macosx-10.9-x86_64-3.7/src/cchardet
creating build/temp.macosx-10.9-x86_64-3.7/src/ext
creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet
creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src
creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src/LangModels
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Isrc/ext/uchardet/src -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.9-x86_64-3.7/src/cchardet/_cchardet.o
In file included from src/cchardet/_cchardet.cpp:609:0:
/usr/local/include/c++/7.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-install-5ud0hb2z/cchardet/setup.py'"'"'; __file__='"'"'/private/var/folders/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-install-5ud0hb2z/cchardet/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/v4/cl9rby0j17gct94qgsksmw9w0000gn/T/pip-record-x2sb36vg/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.**