Search code examples
python-3.xnumpypython-wheel

Cannot install NumPy from a wheel format


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?


Solution

  • 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.