pip 安装wheel 报错xxx.whl is not a supported wheel on this platform.
pip 安装wheel 格式的包时,如果版本不对会报“xxxx.whl is not a supported wheel on this platform”的错误,以本地python 版本为python3.7,安装pycairo为例,
pip install /path/to/pycairo-1.19.1-cp39-cp39-win32.whl
pycairo-1.19.1-cp39-cp39-win32.whl is not a supported wheel on this platform.
文件名中一般会包含类似cp27 或 cp39 等字符串,表明.whl文件所支持的python 版本,需要选择与自己的python 版本对应的wheel 文件。像上面这种情况,只需下载pycairo-1.19.1-cp37-cp37m-win_amd64.whl 这个版本的wheel 文件,再安装就可以了。
另外,还可以通过如下命令查看本地Python 支持的wheel 文件
>>> import pip._internal
>>> pip._internal.pep425tags.get_supported()
冀公网安备 13010402001886号