*.whl is not a supported wheel on this platform

本文介绍了如何解决Python部署环境中出现的“*.whlisnotasupportedwheelonthisplatform”错误。通常这个问题是由Python版本与安装包版本不匹配引起的。文中详细解释了如何检查Python支持的第三方包版本,并提供了三种Python安装包的方式:使用pip安装、下载whl包安装及下载源码压缩包安装。

记一次部署环境问题

报错内容: *.whl is not a supported wheel on this platform
先给结论

  • 遇到这种问题一般是 Python版本支持的 安装包和本地Python版本有冲突;接下来以三个部分阐述下其中原理以作记录!

1. 如何查看Python支持的第三方包版本?

  • 进入Python shell
    >> from pip._internal.pep425tags import get_supported
    >> get_supported()
    # 打印
    [
    ('cp27', 'cp27mu', 'manylinux1_x86_64'), ('cp27', 'cp27mu', 'linux_x86_64'), 
    ('cp27', 'none', 'manylinux1_x86_64'), ('cp27', 'none', 'linux_x86_64'),
    ('py2', 'none', 'manylinux1_x86_64'), ('py2', 'none', 'linux_x86_64'),
    ('cp27', 'none', 'any'),('cp2', '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')
    ]
    

2.Python安装包的三种方式
我们以pymysql为例

  • 1.pip install [-i http://xxx] pymysql
  • 2.whl包下载
  • 3.源码压缩包下载
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值