How to Install a Python Package .Whl File
The most popular way to install the new Python package or library is to use pip
or easy_install
as introduced in Python tutorial installation section.
But sometimes you couldn’t use these tools because of some restrictions like limited internet access. Here we will show you how to install a new Python package with a .whl file.
Python Wheel File Type
Python wheel file or in abbreviation .whl file is a specially formatted zip archive as a Python built-package. It contains all the installation files and could be installed by only unpacking the file.
How to Install Python .Whl (Wheel) File
-
Check
pip
is already installedIf
pip
orpip.exe
is not recognized, install it with thepip
installation tutorial. Or you could check whether it is in the Python scripts directory, but the path of the script is not in the system variable. Then you could simply add the Python scripts path to the system variablePATH
.set PATH=C:\Python\Scripts;%PATH%
Here,
C:\Python\Scripts
should be updated to your own Python installation directory. -
Download the
.whl
fileYou could download the unofficial windows binary for Python extension packages from this trustable UCI website https://www.cgohlke.com/#jpype.
-
Install
.whl
fileFor example, if you have downloaded
pycairo-1.16.3-cp27-cp27m-win32.whl
to the folderC:\Downloads\
. Use the command below to install thewhl
package file.pip install C:\Downloads\pycairo-1.16.3-cp27-cp27m-win32.whl
It’s done. Good luck!
Founder of DelftStack.com. Jinku has worked in the robotics and automotive industries for over 8 years. He sharpened his coding skills when he needed to do the automatic testing, data collection from remote servers and report creation from the endurance test. He is from an electrical/electronics engineering background but has expanded his interest to embedded electronics, embedded programming and front-/back-end programming.
LinkedIn Facebook