在cmd命令行下安装whl文件:
pip install ***.whl
***是文件名,也可以是路径+文件名
报错:***.whl is not a supported wheel on this platform.
原因一:文件和python不匹配(文件名中cm后面的数字和python版本应该匹配)
查看python版本(Shell):
ADM64
import pip._internal
print(pip._internal.pep425tags.get_supported())
WIN32
import pip
print(pip.pep425tags.get_supported())
如果输入不对会出现:AttributeError: module 'pip' has no attribute 'pep425tags'
输入成功可进入python目录,查看支持的版本
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import pip._internal
>>> print(pip._internal.pep425tags.get_supported())
[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('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')]
>>>
下载对应版本,安装whl文件
二、如果版本没有错,那就是wheel没有安装
在cmd命令窗口输入:pip install wheel
提示Successful后安装成功,在找到whl文件安装