Wheel
A wheel is a built, archive-format Python package that contains all the files needed for installation in a pre-compiled format. The .whl
file format was introduced to make Python package installation faster and more reliable than installing from source distributions (.tar.gz
or .zip
files).
Wheels are essentially ZIP files with a special naming convention and internal structure. They contain the package’s Python code, any compiled extensions, and metadata.
Key advantages of wheels include:
- Faster installation since code is pre-compiled
- No compiler needed on the installation system
- Consistent installations across different systems
- Reduced likelihood of installation errors
Wheels come in two varieties:
- Pure Python wheels (marked with
py3-none-any.whl
) that work on any Python 3 installation - Platform-specific wheels that contain compiled code for particular operating systems and Python versions
Package maintainers can build wheels using tools like build
or setuptools
, and users typically install them automatically through pip
, which preferentially chooses wheels over source distributions when available.
Related Resources
Tutorial
What Are Python Wheels and Why Should You Care?
In this tutorial, you'll learn what Python wheels are and why you should care as both a developer and end user of Python packages. You'll see how the wheel format has gained momentum over the last decade and how it has made the package installation process faster and more stable.
For additional information on related topics, take a look at the following resources:
By Dan Bader • Updated Jan. 2, 2025