Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python library from WHL file [duplicate]

Tags:

Skill level: beginner

I am trying to add a library in python. The extension is wheel.

Can somebody tell stepwise approach in installing wheel file?

like image 866
Muhammad Suleman Avatar asked Dec 20 '14 05:12

Muhammad Suleman


People also ask

Can I install two versions of a Python package on the same computer?

With maven or gradle you can install two versions of the same package, with pip you cant. Still you cant use two versions of the same package in the same program.

Can I delete WHL file?

You could delete the wheel package. It won't prevent you from uninstalling the package.

What is .WHL file in Python?

A Python . whl file is essentially a ZIP ( . zip ) archive with a specially crafted filename that tells installers what Python versions and platforms the wheel will support. A wheel is a type of built distribution.


2 Answers

First open a console then cd to where you've downloaded your file like some-package.whl and use

pip install some-package.whl

Note: if pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed. I have multiple Python installations, and needed to use the pip associated with Python 3 to install a version 3 wheel.

If pip is not installed, and you are using Windows: How to install pip on Windows?

like image 84
MarkTab www.marktab.net Avatar answered Oct 05 '22 23:10

MarkTab www.marktab.net


From How do I install a Python package with a .whl file? [sic], How do I install a Python package USING a .whl file ?

For all Windows platforms:

1) Download the .WHL package install file.

2) Make Sure path [C:\Progra~1\Python27\Scripts] is in the system PATH string. This is for using both [pip.exe] and [easy-install.exe].

3) Make sure the latest version of pip.EXE is now installed. At this time of posting:

pip.EXE --version

  pip 9.0.1 from C:\PROGRA~1\Python27\lib\site-packages (python 2.7)

4) Run pip.EXE in an Admin command shell.

 - Open an Admin privileged command shell.

 > easy_install.EXE --upgrade  pip

 - Check the pip.EXE version:
 > pip.EXE --version

 pip 9.0.1 from C:\PROGRA~1\Python27\lib\site-packages (python 2.7)

 > pip.EXE install --use-wheel --no-index 
     --find-links="X:\path to wheel file\DownloadedWheelFile.whl"

Be sure to double-quote paths or path\filenames with embedded spaces in them ! Alternatively, use the MSW 'short' paths and filenames.

like image 32
Hewey Dewey Avatar answered Oct 06 '22 00:10

Hewey Dewey