cmd 使用 pip install时报错:
.whl is not a supported wheel on this platform
这是指whl名的命名不符合它给的规范。
进入python环境输入:
32位python:
>>> import pip
>>> print(pip.pep425tags.get_supported())
64位python:
>>> import pip._internal
>>> print(pip._internal.pep425tags.get_supported())
如果这两个都报错可以试试:
>>> import wheel.pep425tags
>>> print(wheel.pep425tags.get_supported())
似乎对于Py2.7和ip-18.1以上的版本都需要用这种
博主的pip版本是 pip 19.3.1
C:\Users\***\Python37\Scripts>pip --version
pip 19.3.1 from c:\users\***\python37\lib\site-packages\pip (python 3.7)
运行成功后输出结果格式为:
>>> print(wheel.pep425tags.get_supported())
C:\Users\***\Python37\lib\site-packages\wheel\pep425tags.py:83: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
C:\Users\***\Python37\lib\site-packages\wheel\pep425tags.py:88: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
sys.version_info < (3, 8))) \
**[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('cp36', 'none', 'any'), ('cp35', 'none', 'any'), ('cp34', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ('py3', 'none', 'win_amd64'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]**
这样可以看到当前python的支持规范
于是
我只有下载cp37-cp37m-win_amd64.whl才可以正常下载
其他版本均会报错