# Pip Install Wheel (.whl) Files for Python Packages

> Install Python packages from local .whl wheel files using pip install, with guidance on platform compatibility and how pip uses wheels behind the scenes

**URL:** https://sentry.io/answers/install-python-packages-from-wheel-whl-files/

---

## The Problem

I have a Python package in a wheel file (`requests-2.31.0-py3-none-any.whl`). What is this file and how do I install it?

## The Solution

[Wheel files](https://packaging.python.org/en/latest/glossary/#term-Wheel) with the extension `.whl` are *built distributions* of Python packages designed to facilitate quick and easy installation. Unlike source distributions (commonly distributed as `.tar.gz` archives), `.whl` files include precompiled binary components. This means these components do not have to be built as part of the installation process, speeding up the process and avoiding the need for compilers. Pure-Python wheel files are also usually smaller than source distributions, though platform-specific wheels with compiled binaries may be larger.

Because binary components are precompiled, different wheel files may be required for different operating systems. For example, the [`cryptography`](https://pypi.org/project/cryptography) package has [different wheel files for Windows, Linux and macOS](https://pypi.org/project/cryptography/#files). Ensure that the wheel file being installed contains the name of the platform or `any` in its filename.

Python's `pip` package manager supports wheel files and will often use them behind the scenes when downloading from a package repository. If a given package is available in a system-compatible wheel format, `pip` will download and install it instead of the source distribution.

To install a local wheel file, we can pass its name to `pip install`:

```bash
pip install requests-2.31.0-py3-none-any.whl
```

Note that this installation method will be the same whether we're installing the package for our current OS user or within a virtual environment. We can verify the installation by opening a Python interpreter and importing the package:

```python
import requests
```

If no error is produced, the installation was successful.

---

*Source: [sentry.io/answers/install-python-packages-from-wheel-whl-files/](https://sentry.io/answers/install-python-packages-from-wheel-whl-files/)*
