python
install_error
ai_generated
true
错误:命令 'gcc' 以退出状态 1 失败 正在构建 'foo._speedups' 扩展
error: command 'gcc' failed with exit status 1 building 'foo._speedups' extension
ID: python/setuptools-cython-build-ext-failed
80%修复率
84%置信度
0证据数
2024-12-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
一个带 C 扩展(Cython)的包正从 sdist 构建,但编译器工具链或 Python 开发头文件缺失/不兼容,导致 gcc 在扩展构建期间失败。
English
A package with C extensions (Cython) is being built from sdist but the compiler toolchain or Python development headers are missing/incompatible, so gcc fails during the extension build.
解决方案
-
90% 成功率
Install a prebuilt wheel: pip install --only-binary=:all: foo # avoids compilation entirely
-
82% 成功率
Install the toolchain: sudo apt install build-essential python3-dev # then pip install foo
无效尝试
常见但无效的做法:
-
65% 失败
Disabling isolation doesn't install gcc or python-dev headers; the compiler is still absent.
-
60% 失败
Build tooling versions don't affect the missing system compiler/headers; compilation still fails.