二進位安裝檔案下載地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/
問題:pip安裝報錯,XXXX is not a supported wheel on this platform
可能的原因1:安裝的不是對應python版本的庫,下載的庫名中cp27代表python2.7,其它同理。
可能的原因2:這個是我遇到的情況(下載的是對應版本的庫,然後仍然提示不支援當前平台)
我下載到的numpy庫檔案名稱: numpy-1.10.4+mkl-cp27-cp27m-win32.whl
使用pip安裝(在命令列中): pip install numpy-1.10.4+mkl-cp27-cp27m-win32.whl
報錯:*** is not a supported wheel on this platform,通過在stackoverflow上的一個文章成功解決問題。
方法:在shell中輸入import pip; print(pip.pep425tags.get_supported())可以擷取到pip支援的檔案名稱還有版本,我這裡如下:
>>import pip; print(pip.pep425tags.get_supported())[('cp27', 'none', 'win32'), ('py2', 'none', 'win32'), ('cp27', 'none', 'any'), ('cp2', 'none', 'any'), ('cp26', 'none', 'any'), ('cp25', 'none', 'any'), ('cp24', 'none', 'any'), ('cp23', 'none', 'any'), ('cp22', 'none', 'any'), ('cp21', 'none', 'any'), ('cp20', 'none', 'any'), ('py27', 'none', 'any'), ('py2', 'none', 'any'), ('py26', 'none', 'any'), ('py25', 'none', 'any'), ('py24', 'none', 'any'), ('py23', 'none', 'any'), ('py22', 'none', 'any'), ('py21', 'none', 'any'), ('py20', 'none', 'any')]
通過這裡可以發現上面下載的檔案名稱格式是不支援的,修改為:numpy-1.10.4+mkl-cp27-none-win32.whl即可成功安裝。
其它的庫也同理可以成功安裝,不過也請注意庫的依賴。
(參考文章網址:http://stackoverflow.com/questions/28107123/cannot-install-numpy-from-wheel-format?rq=1)