Why Python Wheels Matter
Python wheels (.whl) are the standard, prebuilt distribution format used by pip. Unlike source distributions, wheels are installed without compiling code locally, making them:
- Faster to install (no build step).
- More reliable (fewer compiler or dependency failures).
- Better suited for AI/ML packages, which often include native extensions (C/C++).
On IBM Power, using optimized wheels avoids complex source builds and ensures that the packages are tested and validated for the platform.
Python wheel basics
A wheel file has the extension .whl. A wheel filename is broken down into parts separated by hyphens:
{dist}-{version}(-{build})?-{python}-{abi}-{platform}.whl
Wheel filename format
{package}-{version}-{python tag}-{abi tag}-{platform tag}.whl
Each parameter in {brackets} is a tag, or a component of the wheel name that denotes what the wheel contains and on which platform the wheel will work.
Example:
numpy-1.26.4-cp310-cp310-manylinux2014_ppc64le.whl
This encodes Python version, ABI, OS, and CPU architecture compatibility.
Types of Wheels
There are three types of wheels, and the wheel’s type is reflected in its filename:
- Universal wheel: Contains
py2.py3-none-any.whl. Supports both Python 2 and Python 3 on any OS and platform. Most wheels listed on the Python Wheels website are universal wheels. - Pure Python wheel: Contains either
py3-none-any.whlorpy2-none-any.whl. Supports either Python 3 or Python 2, but not both. It is like the universal wheel, but labeled with eitherpy2orpy3instead ofpy2.py3. - Platform wheel: Supports only a specific Python version and platform. Contains segments indicating a specific Python version, ABI, operating system, or architecture. Common for AI/ML and numerical libraries.
Example: cp312-cp312-manylinux_2_34_ppc64le.whl