1. 程式人生 > >Python:AttributeError: module 'pip' has no attribute 'pep425tags'

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

 

 

之前安裝pyhook時,python是3.6.0版本的了,pyhook也是cp36的了怎麼還是報錯

百度說在shell:

import pip;print(pip.pep425tags.get_supported())

此時報錯:

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

得了,又是個新毛病:

於是找到了部落格:https://blog.csdn.net/qq_33733970/article/details/80503022

AMD64

import pip._internal
print(pip._internal.pep425tags.get_supported())

Win32

import pip
print(pip.pep425tags.get_supported())

 於是在shell裡面輸入了:

import pip
print(pip.pep425tags.get_supported())

結果成功搜尋到了結果;

[('cp36', 'cp36m', 'win32'),
('cp36', 'none', 'win32'), 
('py3', 'none', 'win32'), 
('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')]

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

困惑的是如果是AMD64的是正確的話,那麼下載的應該是

但是實際下載確提示版本不對,

輸入的是Win32下的內容卻報錯AttributeError: module 'pip' has no attribute 'pep425tags'