Install Python library from WHL file

Skill Level: Beginner

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

Can someone say a step-by-step approach when installing a wheel file?

+5
source share
2 answers

First open the console, then cd to which you uploaded your file, for example some-package.whl, and use

pip install some-package.whl 

Note. If pip.exe is not recognized, you can find it in the "Scripts" directory from which python was installed. I have several Python installations, and you need to use the pip associated with Python 3 to install the version 3 wheel.

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

+10
source

From How to install a Python package with a .whl file? [So in the original], How to install a Python package using a .whl file?

For all Windows platforms:

1) Download the installation file for the .WHL package.

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

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

pip.EXE --version

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

4) Run pip.EXE in the admin 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 include double quotes or path \ filenames with embedded spaces in them! In addition, use shortcuts and MSW file names.

+1
source

Source: https://habr.com/ru/post/1209589/


All Articles