查看本机python匹配的文件版本报错
AttributeError: module 'pip' has no attribute 'pep425tags'
下载后安装python第三方库时遇到
is not a supported wheel on this platform
的错误,是因为版本号不匹配的原因,查看本机
python 3.7.2
匹配的文件版本号时报错。
import pip
print(pip.pep425tags.get_supported()
或者
import pip._internal
print(pip._internal.pep425tags.getsupported())
都会报错
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'pip._internal' has no attribute 'pep425tags'
改为
import pip._internal.pep425tags
print(pip._internal.pep425tags.get_supported())
后得到版本号
[, , , , , , , , , , , , , , , , , , , , , , , , , , ]
下载的python第三方库是
numpy-1.18.1+mkl-cp38-cp38-win_amd64.whl
这里是
cp38
,而本机python支持的只达到
cp37
问题解决了,但是我还是不是很明白为什么我用前面两种常规方法会报错哎