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 Export Pandas Dataframe to Multiple Excel Sheets
How to Convert string to UTF-8 in Python
Python Script to Check URL Status
How to Run Python Script in Django Project
How to Remove Duplicates from List in Python
How to Use Sleep Function in Python
How to Terminate Python Subprocess
How to Create Nested Directory in Python
Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.