install package whl file in python

How to Install Python Package with .WHL file

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

Leave a Reply

Your email address will not be published.