python system_error ai_generated true

error: command 'gcc' failed: No such file or directory

ID: python/setuptools-cython-build-error-missing-compiler

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2025-05-30First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.7 active — — —
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —

Root Cause

Building a package with C extensions requires a C compiler (gcc), which is not installed or not in PATH. This is common on Windows without Visual Studio Build Tools or on minimal Linux installations.

generic

中文

构建带有 C 扩展的包需要 C 编译器(gcc),但未安装或不在 PATH 中。这在没有 Visual Studio Build Tools 的 Windows 或最小化 Linux 安装中很常见。

Workarounds

  1. 95% success
    On Linux: sudo apt-get install build-essential. On macOS: xcode-select --install. On Windows: install Microsoft Visual C++ Build Tools.
  2. 85% success
    Use conda to install the package, which provides pre-built binaries: conda install <package>.

Dead Ends

Common approaches that don't work:

  1. 60% fail

    If no wheel is available for the platform, pip falls back to source build and fails again.

  2. 90% fail

    Clang is not installed, so the command still fails.