WHL file, also known as wheel file, are zip archives of packages, with special file names, used by python installers to add new packages. In this article, we will learn how to install python package with .whl file.
How to Install Python Package with .WHL file
It is very easy to install python package with .whl file. Let us say you have downloaded a python package’s whl file named package.whl.
Open terminal and navigate to the location where you have downloaded package.whl file. Run the following command to install whl file.
$ pip install package.whl
If pip is no recognized, you will find it in Scripts directory in python installation directory. If your pip does not support wheel files, run the following command to upgrade it.
$ pip install --upgrade pip
Sometimes, in python 3+, pip may not support whl installation directly. In such cases, first install wheel module with the following command.
$ pip install wheel
Then use wheel command to install package.whl.
$ wheel unpack some-package.whl
Once you have installed python package, you can import it into your code just as you do for any other package.
import package_name
In this article, we have learnt several different ways to install python package using .whl file. You can use any of them as per your requirement.
Also read:
How to Convert JSON to Pandas Dataframe
How to Write List to File in Python
How to Fix Invalid Use of Group Function
How to Insert Current Datetime in PostgreSQL
How to Insert Current Datetime in MySQL
Related posts:
How to Iterate over Multiple Lists in Parallel in Python
How to Combine Multiple CSV Files Using Python
How to Check Version of Python Modules
How to Sort List of Tuples by Second Element in Python
How to Remove All Occurrences of Value from List in Python
How to Remove NaN from List in Python
How to Get Classname of Instance in Python
Random Password Generator in Python with Source Code

Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.