Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install error: "Unknown archive format: .whl"

I'm new to virtualenv (on windows). I'm trying to use pip (1.5) install a local wheel file, but it is failing.

The command is:

pip install --no-index -f C:/Users/<User>/Download openpyxl

In the pip.log, I can see where it finds the correct file, but then doesn't try to install it:

  Skipping link file:///C:/Users/<User>/Download/openpyxl-1.7.0-py2.py3-none-any.whl; unknown archive format: .whl

I have wheel (version 0.22) install globally as well as in the virtual environment. Any idea how I can get .whl to be a recognized format?

like image 777
Brett Stottlemyer Avatar asked Jan 06 '14 12:01

Brett Stottlemyer


People also ask

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.

How do I open a WHL file in Windows?

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.


2 Answers

It appears wheel support is disabled.

Make sure that you have setuptools version 0.8 or newer installed, and that the use-wheel option is not set to false in $HOME/.pip/pip.conf.

Upgrading setuptools is easy enough if pip is already working:

pip install --upgrade setuptools

but note that older virtualenv versions can depend on older setuptools versions; you'll need to make sure that virtualenv is also up to date.

like image 157
Martijn Pieters Avatar answered Oct 24 '22 16:10

Martijn Pieters


I have bumped into the same problem with wheel when downloaded requirements with:

pip install --download /pip_mirror six django_debug_toolbar
dir2pi /pip_mirror/

and tried to install them with:

pip install six-1.7.3-py2.py3-none-any.whl

Even though there is no any config at $HOME/.pip/pip.conf and

$ easy_install --version
setuptools 5.4.1

I still get:

unknown archive format: .whl

I have managed to avoid the problem by adding --no-use-wheel like this, so got only tar.gz files (instead of .whl)

pip install --no-use-wheel --download /pip_mirror six django_debug_toolbar
dir2pi /pip_mirror/

After this pip install --index-url=file:///pip_mirror/simple/ six went without any problems

like image 39
Kostyantyn Avatar answered Oct 24 '22 16:10

Kostyantyn