Cannot install NumPy from a wheel format

Python 3.xNumpyPython Wheel

Python 3.x Problem Overview


I am trying to install NumPy from a wheel (.whl) file. I get the error:

> numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl is not a supported wheel on this platform.

Details:

  • Windows 8.1 pro x64, elevated command prompt

  • Python 3.4.2

  • Package NumPy from Gohlke's site

  • File numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl copied in the pip.exe folder

The log file shows:

> ------------------------------------------------------------ > d:\Program Files\WinPython-64bit-3.4.2.4\python-3.4.2.amd64\Scripts\pip run on 01/23/15 11:55:21
> numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl is not a supported wheel on this platform.
> Exception information:
> Traceback (most recent call last):
> File "D:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
> status = self.run(options, args)
> File "D:\Python34\lib\site-packages\pip\commands\install.py", line 257, in run
> InstallRequirement.from_line(name, None))
> File "D:\Python34\lib\site-packages\pip\req.py", line 167, in from_line
> raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
> pip.exceptions.UnsupportedWheel: numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl is not a supported wheel on this platform.

What is wrong?

Python 3.x Solutions


Solution 1 - Python 3.x

Short answer: rename the file to numpy-1.9.1%2Bmkl-cp34-none-win32.whl to install it.

You can check what tags your pip tool accepts for installation by running:

import pip; print(pip.pep425tags.get_supported())

In this case pip is incorrectly detecting your operating system to be 32-bits and the file you're trying to install was win_amd64 in its filename.

If you rename the file to numpy-1.9.1%2Bmkl-cp34-none-win32.whl (which now contains the tags that are considered supported) then you can install the package. It's a trick because the file is still built for 64-bits but this allows you to install the package as intended.

Solution 2 - Python 3.x

After several tests I think the problem is "win32" or "amd64" itself. I tried replacing those two with "any" and it worked.

Solution 3 - Python 3.x

In my case, the workaround to install gohlke packages on Python (3.4.4 (AMD64)) was to change the "cp34m" part rather than the "win*" parts in previous answers:

python -c "import pip; print(pip.pep425tags.get_supported())":
[('cp34', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'),
('cp34', 'none', 'any'), ...

ls -ld *:

matplotlib-2.0.0b3-cp34-cp34m-win_amd64.whl
numpy-1.11.1+mkl-cp34-cp34m-win_amd64.whl
pandas-0.18.1-cp34-cp34m-win_amd64.whl

Change the above names to:

matplotlib-2.0.0b3-cp34-none-win_amd64.whl
numpy-1.11.1+mkl-cp34-none-win_amd64.whl
pandas-0.18.1-cp34-none-win_amd64.whl

For example, pip install matplotlib-2.0.0b3-cp34-none-win_amd64.whl

Processing ...
...Successfully installed matplotlib-2.0.0b3

Solution 4 - Python 3.x

To add to the list of other possible solutions, I had to upgrade pip itself. The latest binary from Gholke's site had the "cp27m" tag, which didn't show up when I checked the pip tags using:

import pip; print(pip.pep425tags.get_supported())

After I upgraded pip, the wheel didn't work, but just doing a regular pip install numpy worked.

Solution 5 - Python 3.x

If you have, say, Python 3.4 installed, make sure to install the -cp34- version of the wheel and not -cp35-.

Solution 6 - Python 3.x

The current WinPython package manager need a two-characters fix to accept to recognize the new NumPy + mkl 'wheel'.

https://github.com/stonebig/winpython/commit/5e13230609a2e9f4d66d98c3776207ce4b4dd050

Solution 7 - Python 3.x

As a workaround, uninstall the NumPy package:

pip uninstall numpy

Then install it again from cache:

pip install numpy

I had the same problem with several packages after upgrading from 3.4.1 to 3.4.2.

Solution 8 - Python 3.x

Navigate to the directory where your 'pip.py' sits and then type following on the Windows command line:

..\python.exe pip.py install name_of_package.whl

This should work.

Solution 9 - Python 3.x

I had the same problem and tried to work it out with the suggested solutions.

I changed win64 to win32 and it didn't work either. But then I changed the name to original and this time it worked! The only extra thing I did was to go offline. That's so strange.

Solution 10 - Python 3.x

This has nothing to do with your operating system. Uninstall Python 32-bit and install Python 64-bit rather or alternatively find a 32-bit wheel file.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionlmsasuView Question on Stackoverflow
Solution 1 - Python 3.xSimeon VisserView Answer on Stackoverflow
Solution 2 - Python 3.xGaahbonView Answer on Stackoverflow
Solution 3 - Python 3.xuser2974878View Answer on Stackoverflow
Solution 4 - Python 3.xDavidjbView Answer on Stackoverflow
Solution 5 - Python 3.xNoumenonView Answer on Stackoverflow
Solution 6 - Python 3.xstonebigView Answer on Stackoverflow
Solution 7 - Python 3.xjaskView Answer on Stackoverflow
Solution 8 - Python 3.xprku9595View Answer on Stackoverflow
Solution 9 - Python 3.xgeoView Answer on Stackoverflow
Solution 10 - Python 3.xSteven Mark FordView Answer on Stackoverflow