【发布时间】:2019-11-12 10:08:38
【问题描述】:
我正在尝试通过 pip3 将工具安装到我的 Mac 上,但出现以下错误:
编译终止。 错误:命令“gcc”失败,退出状态为 1**
我注意到自 Mohave 以来其他人也有此问题,并建议将位置更改为标题指向的位置,但是随着 Catalina 更新,位置更改为 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include,并且在尝试了 CPATH= 和 C_INCLUDE_PATH= 之后方法我仍然卡住。有没有人也遇到过这个问题?
完全错误:
**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.**
【问题讨论】:
标签: python-3.x gcc pip macos-catalina