pip安装错误:is not a supported wheel on this platform解决办法

当使用pip安装Python库遇到'is not a supported wheel on this platform'错误时,可能是因为文件名格式不正确。通过在Python环境中输入`import pip; print(pip.pep425tags.get_supported())`来查看pip支持的文件格式。例如,将numpy的whl文件名从numpy-1.16.6-cp27-cp27m-win32.whl更改为numpy-1.16.6-cp27-none-win32.whl即可解决问题。若提示'module' object has no attribute 'pep425tags',则需用`import pip._internal; print(pip._internal.pep425tags.get_supported())`代替。
部署运行你感兴趣的模型镜像
  • 使用pip安装python库

python安装库可以使用:pip install 库名称==版本号,比如 pip install numpy==1.16.6

也可以下载.whl文件进行安装,命令行下将地址切换到.whl所在的位置:pip install XXX.whl

python库下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs

                                    https://pypi.org/

下载的库文件名中的cp27代表python2.7

 

  • is not a supported wheel on this platform问题

pip安装.whl文件可能会报错:is not a supported wheel on this platform

有可能是文件名格式不对

打开python,输入import pip; print(pip.pep425tags.get_supported())可以获取到pip支持的文件名还有版本,显示如下:

>>import pip; print(pip.pep425tags.get_supported())
[('cp27', 'none', 'win32'), ('py2', 'none', 'win32'), ('cp27', 'none', 'any'), ('cp2', 'none', 'any'), ('cp26', 'none', 'any'), ('cp25', 'none', 'any'), ('cp24', 'none', 'any'), ('cp23', 'none', 'any'), ('cp22', 'none', 'any'), ('cp21', 'none', 'any'), ('cp20', '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')]

我下载的numpy的库文件名是numpy-1.16.6-cp27-cp27m-win32.whl,因此,需要将库文件名改为numpy-1.16.6-cp27-none-win32.whl即可

 

  • ’module‘ object has no attribute 'pep425tags'问题

在python中输入import pip; print(pip.pep425tags.get_supported())可能会报错:‘module’ object has no attribute 'pep425tags'

解决方法:命令替换为:import pip._internal;print(pip._internal.pep425tags.get_supported())即可

 

参考:

https://blog.youkuaiyun.com/Redboy_Crazy/article/details/83020270

https://blog.youkuaiyun.com/Cinderella___/article/details/83030134

您可能感兴趣的与本文相关的镜像

Python3.11

Python3.11

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值