linux python3安装whl包时报错解决:is not a supported wheel on this platform
原因1
你下载安装的包不是当前平台所支持的
原因2
你下载的包,不符合你所在的平台的安装whl的名称规范,所以出错。
比如当前我要安装的包是:pymssql-2.1.5-cp36-cp36m-manylinux1_x86_64.whl
但是在我的系统中使用如下命令安装:
1 | pip3 install pymssql_linux - 2.1 . 6 - cp36 - cp36m - manylinux2010_x86_64.whl |
但是出现了下面的错误提示:
1 | pymssql_linux - 2.1 . 6 - cp36 - cp36m - manylinux2010_x86_64.whl is not a supported wheel on this platform. |
解决办法1
在shell中运行python,然后输入如下的命令:
1 2 | [root@localhost ~] python3 >> import pip; print (pip.pep425tags.get_supported()) |
输出结果如下:
1 | [( 'cp36' , 'cp36m' , 'manylinux1_x86_64' ), ( 'cp36' , 'cp36m' , 'linux_x86_64' ), ( 'cp36' , 'abi3' , 'manylinux1_x86_64' ), ( 'cp36' , 'abi3' , 'linux_x86_64' ), ( 'cp36' , 'none' , 'manylinux1_x86_64' ), ( 'cp36' , 'none' , 'linux_x86_64' ), ( 'cp35' , 'abi3' , 'manylinux1_x86_64' ), ( 'cp35' , 'abi3' , 'linux_x86_64' ), ( 'cp34' , 'abi3' , 'manylinux1_x86_64' ), ( 'cp34' , 'abi3' , 'linux_x86_64' ), ( 'cp33' , 'abi3' , 'manylinux1_x86_64' ), ( 'cp33' , 'abi3' , 'linux_x86_64' ), ( 'cp32' , 'abi3' , 'manylinux1_x86_64' ), ( 'cp32' , 'abi3' , 'linux_x86_64' ), ( 'py3' , 'none' , 'manylinux1_x86_64' ), ( 'py3' , 'none' , 'linux_x86_64' ), ( 'cp36' , 'none' , 'any' ), ( 'cp3' , 'none' , 'any' ), ( 'py36' , 'none' , 'any' ), ( 'py3' , 'none' , 'any' ), ( 'py35' , 'none' , 'any' ), ( 'py34' , 'none' , 'any' ), ( 'py33' , 'none' , 'any' ), ( 'py32' , 'none' , 'any' ), ( 'py31' , 'none' , 'any' ), ( 'py30' , 'none' , 'any' )] |
其中有一个('cp36', 'cp36m', 'manylinux1_x86_64')
意味着如果我要安装python3.6版本的whl,那么我的whl文件中应该是manylinux1_x86_64
而不是manylinux2010_x86_64
,所以我将文件名改成pymssql-2.1.5-cp36-cp36m-manylinux1_x86_64.whl,然后再进行安装,结果安装成功。
如果上面命令在linux平台报错,可以执行下面的命令,这就可以看到pip支持的文件名和版本了。
1 | python -m pip debug --verbose |
本文作者:香菜哥哥
本文链接:https://www.cnblogs.com/yizhipanghu/p/14265663.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步