Python 安裝庫文件 is not a supported wheel on this platform的解決辦法
1 問題描述
2 問題原因分析
3 解決方案
3.1 獲取pip支持的文件名和版本
3.2 下載特定版本的庫
3.3 安裝
4 其他解決方案
1 問題描述
本人最近安裝python版的GDAL庫,下載的版本為GDAL-3.1.2-cp39-cp39-win_amd64.whl CMD執行命令:pip install GDAL-3.1.2-cp39-cp39-win_amd64.whl 卻出現錯誤提示: ERROR: GDAL-3.1.2-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.
E:\python\Lib\site-packages>pip install GDAL-3.1.2-cp39-cp39-win_amd64.whl
ERROR: GDAL-3.1.2-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.
在網上搜索到的查看pip支持的文件名和版本的命令及自己的運行結果(在自己的電腦上不可行)分別是: 1 執行:import pip; print(pip.pep425tags.get_supported()) 輸出:Traceback (most recent call last): File “<pyshell#0>”, line 1, in import pip; print(pip.pep425tags.get_supported()) AttributeError:module ‘pip’ has no attribute 'pep425tags’
>>> import pip;
>>> print(pip.pep425tags.get_supported())
Traceback (most recent call last):File "<pyshell#0>", line 1, in <module>import pip; print(pip.pep425tags.get_supported())
AttributeError: module 'pip' has no attribute 'pep425tags'
2 執行:import pip._internal.pep425tags 輸出:Traceback (most recent call last): File “<pyshell#1>”, line 1, in import pip._internal.pep425tags ModuleNotFoundError: No module named 'pip._internal.pep425tags’
>>> import pip._internal.pep425tags
Traceback (most recent call last):File "<pyshell#1>", line 1, in <module>import pip._internal.pep425tags
ModuleNotFoundError: No module named 'pip._internal.pep425tags'
3 執行:import pip._internal;print(pip._internal.pep425tags.get_supported()) 輸出:Traceback (most recent call last): File “<pyshell#3>”, line 1, in print(pip._internal.pep425tags.get_supported()) AttributeError: module ‘pip._internal’ has no attribute 'pep425tags’
>>> import pip._internal
>>> print(pip._internal.pep425tags.get_supported())
Traceback (most recent call last):File "<pyshell#3>", line 1, in <module>print(pip._internal.pep425tags.get_supported())
AttributeError: module 'pip._internal' has no attribute 'pep425tags'
執行:import wheel.pep425tags as w 輸出:Traceback (most recent call last): File “<pyshell#4>”, line 1, in import wheel.pep425tags as w ModuleNotFoundError: No module named 'wheel’
>>> import wheel.pep425tags as w
Traceback (most recent call last):File "<pyshell#4>", line 1, in <module>import wheel.pep425tags as w
ModuleNotFoundError: No module named 'wheel'
C:\Users\zy>python -m pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 20.2.2 from E:\python\lib\site-packages\pip (python 3.8)
sys.version: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
sys.executable: E:\python\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp936
sys.platform: win32
sys.implementation:name: cpython
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): E:\python\lib\site-packages\pip\_vendor\certifi\cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:appdirs==1.4.4CacheControl==0.12.6colorama==0.4.3contextlib2==0.6.0.post1 (Unable to locate actual module version, using vendor.txt specified version)distlib==0.3.1distro==1.5.0 (Unable to locate actual module version, using vendor.txt specified version)html5lib==1.1ipaddress==1.0.23msgpack==1.0.0 (Unable to locate actual module version, using vendor.txt specified version)packaging==20.4pep517==0.8.2progress==1.5pyparsing==2.4.7requests==2.24.0certifi==2020.06.20chardet==3.0.4idna==2.10urllib3==1.25.9resolvelib==0.4.0retrying==1.3.3 (Unable to locate actual module version, using vendor.txt specified version)setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)six==1.15.0toml==0.10.1webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 30cp38-cp38-win_amd64cp38-abi3-win_amd64cp38-none-win_amd64cp37-abi3-win_amd64cp36-abi3-win_amd64cp35-abi3-win_amd64cp34-abi3-win_amd64cp33-abi3-win_amd64cp32-abi3-win_amd64py38-none-win_amd64py3-none-win_amd64py37-none-win_amd64py36-none-win_amd64py35-none-win_amd64py34-none-win_amd64py33-none-win_amd64py32-none-win_amd64py31-none-win_amd64py30-none-win_amd64cp38-none-anypy38-none-anypy3-none-anypy37-none-anypy36-none-anypy35-none-anypy34-none-anypy33-none-anypy32-none-anypy31-none-anypy30-none-any