# error: command '/usr/bin/gcc' failed with exit code 1

Cython.Compiler.Errors.CompileError: foo/_bar.pyx

- **ID:** `python/setuptools-cython-build-failure`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A Cython extension failed to compile because of a missing C header, an incompatible compiler, or a Cython version mismatch with the .pyx source.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (80% success)
   ```
   Install build prerequisites (e.g. `sudo apt-get install python3-dev libfoo-dev`) and pin a matching Cython: `pip install 'cython<3'` or `'cython>=3'` per the project's docs.
   ```
2. **** (85% success)
   ```
   Prefer a prebuilt wheel: `pip install --only-binary=:all: <pkg>` to avoid compiling at all.
   ```

## Dead Ends

- **** — The compiler error is deterministic. (90% fail)
- **** — Optimization level is not the cause of a CompileError. (80% fail)
