58

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lmsasu
  • 7,459
  • 18
  • 79
  • 113
  • 4
    Could you open `python` and run `import pip; print(pip.pep425tags.get_supported())`? – Simeon Visser Jan 23 '15 at 11:30
  • 1
    [('cp34', 'none', 'win32'), ('cp34', 'none', 'any'), ('cp3', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ('py34', 'none', 'any'), ('py3', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')] – lmsasu Jan 23 '15 at 11:34
  • It doesn't seem to have the tags in the filename of the `.whl` so perhaps this file isn't for your platform? – Simeon Visser Jan 23 '15 at 13:33
  • 1
    What do you get when you run `import platform; print(platform.platform())`? Perhaps your system isn't being detected properly as 64-bit. – Simeon Visser Jan 23 '15 at 13:44
  • It reports: Windows-8-6.2.9200 – lmsasu Jan 23 '15 at 14:00
  • "It doesn't seem to have the tags in the filename of the .whl so perhaps this file isn't for your platform?" - my file name is ...cp34... and the supported tags include "('cp34', 'none', 'any')" - shouldn't then this whl file be supported? – lmsasu Jan 23 '15 at 14:09
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69451/discussion-between-lmsasu-and-simeon-visser). – lmsasu Jan 23 '15 at 14:10
  • Much later: I decided to use the anaconda distribution. It comes with plenty of packages preinstalled. Other packages can be added through pip (I already did this, with some github packages). – lmsasu Jun 03 '15 at 10:26

10 Answers10

82

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.

Simeon Visser
  • 118,920
  • 18
  • 185
  • 180
  • 3
    After a real-time chat with Simeon, the problem was solved - thanks. Now the question is: how could I convince the pip system to see my machine as a x64 system - as it actually is? On x64 platform I could benefit from the 32 GB of RAM. – lmsasu Jan 23 '15 at 14:25
  • 1
    @lmsasu: it's possibly related to this bug: http://bugs.python.org/issue18987 - are you running a 32-bits Python interpreter on a 64-bits OS? Or, if not, we may have found a related but different bug. pip calls `distutils.utils.get_platform()` to determine the platform. – Simeon Visser Jan 23 '15 at 14:30
  • Strange, but the winpython distribution shows [('cp34', 'none', 'win_amd64'), ('cp34', 'none', 'any'), ('cp3', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ] so the cp34 with windows x64 is seen here. Note that winpython comes with numpy included. – lmsasu Jan 23 '15 at 14:32
  • 1
    Now if you upgrade to pip 8.0.2+ , then the problem is solved. To upgrade on windows see this [answer](http://stackoverflow.com/a/29886593/2182047) too. – lalthomas Feb 03 '16 at 14:23
  • 3
    The *filename* matters?? That's dumb. Doesn't it have metadata inside the file to tell what version it goes with? Mine was failing because the file was named `scikits.audiolab-0.11.0-cp27-none-win32_001.whl` by a download manager. – endolith Mar 21 '16 at 18:41
  • @endolith: consider a package index - the filename is used to determine what package to download for the platform that's trying to install it. The installer (pip) won't download / open all files to determine what file to install so the metadata should be located outside the file somehow. – Simeon Visser Mar 21 '16 at 21:07
  • I couldn't install neither 32 or 64 bit wheel packages of different libraries for Python 3.4, and this solved the issue. The general solution is to change the `cp34m` part in the .whl filename to `none`. – Attila Tanyi May 04 '16 at 10:52
  • 1
    It has nothing to do with your operating system. Install Python 64bit not 32bit. – Steven Mark Ford Dec 04 '16 at 17:03
  • GREAT!! Best answer! – hello123 Oct 15 '17 at 11:47
  • This no longer works, you need to use: `python3 -c "import wheel.pep425tags as w; print(w.get_supported())" |sed -zE 's/\),/),\n/g'`. – not2qubit Nov 20 '18 at 00:31
  • 2
    `pip debug --verbose` this is easier, replace name of the file with something out of this list – Voilin Aug 19 '21 at 20:52
18

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Gaahbon
  • 191
  • 2
9

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user2974878
  • 121
  • 1
  • 3
6

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Davidjb
  • 1,190
  • 1
  • 12
  • 19
3

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

Noumenon
  • 5,099
  • 4
  • 53
  • 73
2

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
stonebig
  • 1,193
  • 1
  • 9
  • 13
2

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
jask
  • 21
  • 1
2

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
prku9595
  • 21
  • 1
2

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
geo
  • 21
  • 2
1

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Steven Mark Ford
  • 3,372
  • 21
  • 32