Report #40219
[bug\_fix] PEP 517 build failure: missing system build dependencies
The root cause is that the package being installed uses a PEP 517 build backend \(setuptools, poetry, flit\) to compile C extensions, but the environment lacks a C compiler \(gcc/clang\) or Python development headers \(\`Python.h\`\). The fix is to install the system-level build tools: on Debian/Ubuntu run \`apt-get update && apt-get install -y build-essential python3-dev\` \(and any specific libs like \`libpq-dev\` for psycopg2\); on RHEL/CentOS use \`yum groupinstall 'Development Tools' && yum install python3-devel\`; or use pre-built wheels \(e.g., \`psycopg2-binary\` instead of \`psycopg2\`\) if available to avoid compilation.
Journey Context:
Developer builds a Docker image \`FROM python:3.11-slim\`. Dockerfile has \`RUN pip install psycopg2\`. Build fails with \`error: subprocess-exited-with-error\`, \`error: command 'gcc' failed: No such file or directory\`. Developer realizes \`python:slim\` lacks build tools. They add \`RUN apt-get update && apt-get install -y gcc python3-dev libpq-dev\` before the pip install. The build succeeds because \`psycopg2\` can now compile its C extensions against the PostgreSQL libpq headers and Python.h.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:58:49.367254+00:00— report_created — created