How to install a .whl file in Python with pip
Codemia Knowledge Hub ·
To install a Python package from a .whl file, run pip install path/to/package.whl. Wheels are pre-built binary distributions, so they install faster than source distributions because there is no compilation step. They are the standard distribution format and replaced eggs as of PEP 427.
What the .whl filename tells pip
A .whl file is a ZIP archive whose name tells pip which Python version, ABI and platform it targets:
For example:
| Component | Value | Meaning |
| Package | numpy | Package name |
| Version | 1.26.4 | Package version |
| Python tag | cp312 | CPython 3.12 |
| ABI tag | cp312 | CPython 3.12 ABI |
| Platform tag | macosx_11_0_arm64 | macOS 11+ on Apple Silicon |
A wheel with py3-none-any in its name is pure Python and works on any platform with any Python 3 version.
Installing a wheel step by step
1. Check your pip version
Pip 1.4+ supports wheels natively. Check and upgrade if needed:
2. Install the wheel
From the directory containing the .whl file:
Or pass the full path from anywhere:
3. Verify the installation
Installing into a virtual environment
Install into a virtual environment to avoid conflicts with system Python:
Where to get .whl files
PyPI
Download wheels from PyPI for offline installation or a specific version:
Unofficial Windows binaries
For Windows packages that are hard to compile (like GDAL, rasterio, or Shapely), Christoph Gohlke's archive at https://www.lfd.uci.edu/~gohlke/pythonlibs/ historically provided pre-built wheels. The site is now archived, and many of these packages publish official wheels on PyPI.
Building your own wheel
Installing several wheels and their dependencies
By default pip resolves a wheel's dependencies from PyPI and installs them automatically:
For a fully offline install, download all dependencies first:
Wheel vs. source distribution vs. egg
| Feature | Wheel (.whl) | Source dist (.tar.gz) | Egg (.egg) |
| Format | ZIP archive | Compressed tarball | ZIP archive |
| Installation speed | Fast (no compilation) | Slow (may compile C extensions) | Fast |
| Build step required | No | Yes (runs setup.py) | No |
| PEP standard | PEP 427 (current) | PEP 625 | Deprecated |
| Arbitrary code at install | No | Yes (setup.py runs) | No |
| Security | Safer | Riskier (arbitrary code) | Safer |
Wheels do not execute arbitrary code during installation. Source distributions run setup.py, which can execute anything.
Matching your Python and platform tags
A wheel installs only if your environment matches its tags. To see what your pip supports:
This lists supported tags like:
pip has no flag that skips this tag check; --force-reinstall still fails with "is not a supported wheel on this platform". Renaming the file to match your platform is the only workaround, and it is not recommended because it may cause runtime crashes.
Errors when installing a wheel
- "is not a supported wheel on this platform". The wheel's Python version, ABI or platform tag does not match your environment, usually because it was built for a different Python version or OS. Check with
pip debug --verbose. - "No matching distribution found". With
--find-links, pip might skip the local.whlif a newer version exists on PyPI. Add--no-indexto use only local files. sudo pip install. This installs into the system Python and can break OS-level tools. Use a virtual environment, orpip install --user package.whlif you must install system-wide.- Old pip. Versions before 1.4 do not support wheels, and versions before 19.0 do not support
manylinux2010wheels. Runpip install --upgrade pipfirst. - Missing compilers on source fallback. If no wheel is available and pip builds from source, you need compilers (gcc, MSVC) and development headers. Wheels exist to avoid exactly this.
pip install wheelis not installing your file. The package namedwheelis a build tool; installing it does not install a.whlfile you downloaded.
Related reading
- How do I install opencv using pip?
- How do I install pip on macOS or OS X?
- How do I install pip on Windows?
- How do I install Python 3 on an AWS EC2 instance?
- How do I install Python OpenCV through Conda?
- How do I install tensorflow_text?
- How do I install TensorFlow's tensorboard?
- How do I install the yaml package for Python?
System design interview problems on this topic
- Design a Web Crawler: solution and walkthrough
- Design a Task Scheduler: solution and walkthrough
- Design a URL Shortener (TinyURL): solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.