I'm having trouble installing a Python package on my Windows machine, and would like to install it with Christoph Gohlke's Window binaries. (Which, to my experience, alleviated much of the fuss for many other package installations). However, only .whl files are available.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype
But how do I install .whl files?
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.
If you cannot open your WHL file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a WHL file directly in the browser: Just drag the file onto this browser window and drop it.
whl files are just zip archives, so you can just extract their content and play with libraries path variable to make it work.
There's a slight difference between accessing the .whl file in python2 and python3. In python3, you need to install wheel first and then you can access .whl files. Show activity on this post. In-case if you unable to install specific package directly using PIP.
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: 4) Run pip.EXE in an Admin command shell.
If your package is not present in PyPI, you can search for Python package on unofficial sites. After you download a file, you can use a file archiver, such as 7zip and look inside it. You will notice that the wheel consists of many py, txt, json, dll, and exe files.
You can install the .whl file, using pip install filename. Though to use it in this form, it should be in the same directory as your command line, otherwise specify the complete filename, along with its address like pip install C:SomePAthfilename.
I just used the following which was quite simple. 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. If pip is not installed, this page can help: How do I install pip on Windows?
Note: for clarification
If you copy the *.whl
file to your local drive (ex. C:\some-dir\some-file.whl) use the following command line parameters --
pip install C:/some-dir/some-file.whl
First, make sure you have updated pip to enable wheel support:
pip install --upgrade pip
Then, to install from wheel, give it the directory where the wheel is downloaded. For example, to install package_name.whl
:
pip install --use-wheel --no-index --find-links=/where/its/downloaded package_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With