Python 3 AttributeError: module 'pip' has no attribute 'pep425tags'

错误:

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

正确:

>>> import pip._internal
>>> print(pip._internal.pep425tags.get_supported())
[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), 
('py3', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), 
('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), 
('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), 
('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
>>>  

或者:

>>> import pip; print(pip._internal.pep425tags.get_supported())
[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'),
 ('py3', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), 
 ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), 
 ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), 
 ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
>>> 

虽然按python给出的正确匹配格式修改,安装过程中仍然报错
在这里插入图片描述

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值