python
install_error
ai_generated
true
错误:命令'gcc'失败:没有那个文件或目录
error: command 'gcc' failed: No such file or directory
ID: python/setuptools-command-not-found
80%修复率
90%置信度
0证据数
2024-01-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.10 | active | — | — | — |
根因分析
当构建带有C扩展的Python包时,setuptools尝试调用C编译器,但gcc未安装或不在PATH中。
English
When building a Python package with C extensions, setuptools tries to invoke the C compiler, but gcc is not installed or not in PATH.
解决方案
-
95% 成功率
apt-get install build-essential (Debian/Ubuntu) or yum install gcc (RHEL)
-
80% 成功率
pip install --only-binary :all: package
-
70% 成功率
export CC='clang' if clang is available
无效尝试
常见但无效的做法:
-
100% 失败
Still fails because the compiler doesn't exist.
-
70% 失败
Skips isolation but still needs a compiler.
-
60% 失败
Headers are not enough; compiler binary is required.