How to Install a Python Package with a .whl File?
Last Updated :
26 Apr, 2025
To install a Python package using a .whl (wheel) file, you'll need to follow a few simple steps. The first method involves using PowerShell along with pip and the cd command to change the directory to where your .whl file is located. The second method uses PowerShell and pip directly, without changing directories.
What is a wheel file?
It is a built-package format for Python. A wheel could be a ZIP-format archive with a specially formatted name and therefore the .whl extension. it's designed to contain all the files for a PEP 376 compatible, install in such a way that is very close to the on-disk format. several packages are properly put in with solely the “Unpack” step (simply extracting the file onto sys.path), and therefore the unpacked archive preserves enough info to “Spread” (copy information and scripts to their final locations) at any later time.
Using Powershell + pip + cd (change directory command)
Step 1: First, we need to download our desired .whl file from the official PyPi website (pypi.org), open the website and click on browse projects.
Download .whl FileStep 2: After clicking browse projects click on the Python 3 compatible projects
Compatibe ProjectsStep 3: After clicking Python 3 compatible projects, search for the desired package of user's choice. In this tutorial I will be downloading and installing the PyAudio package so I will download that (user might download any other package, the process of installation is same).
PyAudio PackageStep 4: After searching and finding the package user wants, the user needs to click on that package, and on the left there would be a section called Download files (under Navigation), click on that and the user will see .whl file of different versions of the package. Here the user needs to be very careful about the Python version they have installed on their device and the type of OS is installed in their machine (32 or 64-bit). For Windows and AMD 64-bit, the same file will work on both, if the user has 32-bit installed then download the file which has win32 in its name.
Just click on the specific package and it will be downloaded.
Downloading PackagesThe first version is the latest one which supports Python 3.11 and will run on Windows and AMD 64-bit machines, the second one also supports Python 3.11 but will work on Windows 32-bit machines. Then the third and the fourth support Python 3.10 64bit and 32bit machines etc.
Step 5: Now open Windows Powershell in Administrator mode, then change the directory using the cd command to where the downloaded file is located.
cd <Entire_Path_of_the_folder_in_which_it_is_downloaded>
Change DirectoryStep 6: Now as we are now in the folder where it has been downloaded, run the following command in Powershell.
pip install <downloaded_wheel_filename_with_extension>
Run CommandUsing Powershell + pip
Step 1: Open Windows Powershell in Administrator mode.
Step 2: Just run the below command
pip install <Location_of_the_downloaded_file\entire_filename_with_extension>
Solutions of some problems user might face while installing -
- If users face any problem running the command in PowerShell regarding any 'Permission', then they should close and reopen the Powershell As Administrator.
- Sometimes in the case of Python 3.x user needs to use pip3 instead of pip, so if the user gets any error regarding the pip (except: 'Pip' is not recognized as an external or internal command, for this purpose user needs the to add the location of pip in the path inside system variable, or simply reinstall Python or Modify it and while doing so check the option ADD to Path.
- The user using an old version of pip, upgrades it by running the below command.
pip install --upgrade pip
or
python -m pip install --upgrade pip
- If the pip or pip3 command still gives an error then the user should use the following command.
python -m pip install <package_name.whl>
Similar Reads
How to Install bottle package in python?
The bottle is a lightweight, WSGI-based micro web framework package for the Python language. One of the best features of this package is that it is distributed as a single file and it supports Python 2.7 and Python 3. This package is available for Windows, Linux, and macOS. Features of Bottle No dep
1 min read
How to install a Python Package from a GitHub Repository
In this article we will learn how to install a pip package from a git repository, PIP supports installing from various version control systems (VCS). This support requires a working executable to be available (for the version control system being used). It is used through URL prefixes: Git -- git+ M
2 min read
How to Install Python Package in Google's Colab
Installing a Python package in Google Colab is like going on a space adventure with your keyboard as a trusty spaceship. Don't worry, fellow coder, the world of Python packages is ready for your exploration. with just a few lines of code, you can easily bring in the tools for your coding adventure.
3 min read
How to Install Python chardet package on Ubuntu?
Chardet is the python module that is mainly used to detect the character encoding in a text file. Or we can say that this module is used to take a sequence of bytes in unknown characters encoding and try to find the encoding so the user can read the text. In this article, we will be looking at the s
2 min read
How to Install Python Dash with Conda ?
Dash is a very useful Python tool. It is used to create a Python framework. Because of its popularity among developers, Dash is frequently used to create interactive dashboards in online applications. Dash is a Python library that is similar to Flask and Plotly. An Anaconda is referred to as a Conda
2 min read
How to Install python 'bottle package' on Linux?
py-bottle is a lightweight micro-framework for developing small web apps and it supports request dispatching (Routes) with URL parameter support, templates, a built-in HTTP Server, and adapters for several third-party WSGI/HTTP-server and template engines are all included in a single file with no de
2 min read
How to Install python3-xlib package on Linux?
The Python3-xlib Library is intended to be a fully functional X client library for Python programs. It is written entirely in Python language, indifference to earlier X libraries for Python (the ancient X extension and the newer plxlib) which were interfaces to the C Xlib. So, in this article, we wi
2 min read
How to Install python packages Locally with easy_install?
easy_install was included in setuptools in 2004 and is now deprecated. It was remarkable at the time to automatically install dependencies and install packages from PyPI using requirement specifiers. Pip was released later in 2008 as a replacement for easy install, albeit it was still primarily base
1 min read
How To Install Python Using Ansible Playbook ?
Automation is now absolutely necessary for the effective management of software deployment and infrastructure in IT landscape. Ansible emerges as a main automation tool, eminent for its effortlessness, simplicity, and flexibility. Software installation, configuration management, and application depl
7 min read
How to Install SimpleJson Package for Python?
In this article, we will see how to Install SimpleJson Package for Python SimpleJson is an open-source package in python. It is a fast, simple, correct, and extensible JSON encoder and decoder for python. Python's built-in JSON library has been externally developed to provide backward compatibility
2 min read