pip install .whl文件时is not a supported wheel on this platform.解决方法

 首先,在python中输入import pip和print(pip.pep425tags.get_supported()),从而获取pip支持的文件名和版本。

somnus@somnus-HP-Pavilion-Notebook:~$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> print(pip.pep425tags.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')]

 然后,选择支持的.whl文件下载即可,如下图,由于支持('cp27', 'cp27mu', 'manylinux1_x86_64'),所以可下载opencv_python-3.4.3.18-cp27-cp27mu-manylinux1_x86_64.whl。

PS:上述方法有时会报错:

>>> import pip
>>> print(pip.pep425tags.get_supported())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pep425tags'

此时,对于python2.7,可采用:

>>> import wheel.pep425tags
>>> print(wheel.pep425tags.get_supported())

解决方案参考:https://stackoverflow.com/questions/50248524/module-pip-has-no-attribute-pep425tags

 

转载于:https://www.cnblogs.com/tyty-Somnuspoppy/p/9970033.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值