Report #104429
[bug\_fix] fatal error: Python.h: No such file or directory
Install the Python development headers: \`sudo apt install python3-dev\` \(Debian/Ubuntu\), \`sudo yum install python3-devel\` \(RHEL/CentOS\), or \`brew install python3\` \(macOS, which includes headers\).
Journey Context:
Developer tried to install a package with C extensions \(e.g., \`pip install numpy\`, \`psycopg2\`, or \`cryptography\`\) on a fresh Ubuntu server. The installation failed with a compilation error about missing \`Python.h\`. They assumed the issue was with the package, but after checking the build log, they realized the C compiler could not find the Python C API headers. The fix: installing \`python3-dev\` provides the header files and static library needed for building extensions. After installation, \`pip install\` succeeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-16T20:06:42.301648+00:00— report_created — created