Interview Prep/Build Tools (Java, Node.js, Python, .NET)/Python builds (pip, venv, requirements.txt)

What is a Python wheel?

IntermediateConceptPython builds (pip, venv, requirements.txt)
Answer

Short answer

A wheel (.whl file) is a pre-built Python package, ready to install by just unpacking it — no build step. Wheels for packages with C code are built per platform and Python version (e.g. cp312-manylinux_x86_64), which is why pip installs them in seconds instead of compiling for minutes.

Example filename

numpy-2.0.1-cp312-cp312-manylinux_2_17_x86_64.whl
       │      │            └── platform (Linux, x86_64, glibc 2.17+)
       │      └── CPython 3.12
       └── version

Why it matters in DevOps

  • Fast, reliable builds — no compilers needed in the image.
  • If no matching wheel exists (new Python version, Alpine/musl, ARM), pip falls back to the source distribution and needs gcc and headers.
  • You can build your own wheels once and reuse them: pip wheel -r requirements.txt -w wheels/, then pip install --no-index --find-links wheels/ -r requirements.txt in the final stage.

What to say in the interview

"A wheel is a pre-built package, platform-specific when it contains compiled code. Using wheels keeps images free of compilers and builds fast; when none matches the platform, pip compiles from source, which is the usual cause of gcc errors."

All Build Tools (Java, Node.js, Python, .NET) questions Roadmap: Python apps: pip, venv & requirements.txt

More on Python builds (pip, venv, requirements.txt)