python报错:whl is not a supported wheel on this platform.解决办法
1.问题描述
下载好JPype.whl文件后,使用pip install .\JPype1-1.4.0-cp310-cp310-win_amd64.whl
安装,报错:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: JPype1-1.4.0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.
意为python版本与JPype1版本不匹配
2.解决办法
使用pip debug --verbose
查看当前python适用的whl版本
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 22.1.2 from E:\python_projects\LDA_Key_Label\KeyWord_env\lib\site-packages\pip (python 3.8)
sys.version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
sys.executable: E:\python_projects\LDA_Key_Label\KeyWord_env\Scripts\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp936
sys.platform: win32
sys.implementation:
name: cpython
'cert' config value: global
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): E:\python_projects\LDA_Key_Label\KeyWord_env\lib\site-packages\pip\_vendor\certifi\cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
CacheControl==0.12.11
colorama==0.4.4
distlib==0.3.3
distro==1.7.0
html5lib==1.1
msgpack==1.0.3 (Unable to locate actual module version, using vendor.txt specified version)
packaging==21.3
pep517==0.12.0
platformdirs==2.5.2
pyparsing==3.0.8
requests==2.27.1
certifi==2021.10.08
chardet==4.0.0
idna==3.3
urllib3==1.26.9
rich==12.2.0 (Unable to locate actual module version, using vendor.txt specified version)
pygments==2.11.2
typing_extensions==4.2.0 (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)
tenacity==8.0.1 (Unable to locate actual module version, using vendor.txt specified version)
tomli==2.0.1
webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 30
cp38-abi3-win_amd64
cp38-none-win_amd64
cp37-abi3-win_amd64
cp36-abi3-win_amd64
cp35-abi3-win_amd64
cp34-abi3-win_amd64
cp33-abi3-win_amd64
cp32-abi3-win_amd64
py38-none-win_amd64
py3-none-win_amd64
py37-none-win_amd64
py36-none-win_amd64
py35-none-win_amd64
py34-none-win_amd64
py33-none-win_amd64
py32-none-win_amd64
py31-none-win_amd64
py30-none-win_amd64
cp38-none-any
py38-none-any
py3-none-any
py37-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
从中我们可以看到Compatible tags字样,这些就是当前Python版本可以适配的标签。例如,我的Python版本是3.8,可以匹配下面这些文件名:
Compatible tags: 30
cp38-abi3-win_amd64
cp38-none-win_amd64
cp37-abi3-win_amd64
cp36-abi3-win_amd64
cp35-abi3-win_amd64
cp34-abi3-win_amd64
cp33-abi3-win_amd64
cp32-abi3-win_amd64
py38-none-win_amd64
py3-none-win_amd64
py37-none-win_amd64
py36-none-win_amd64
py35-none-win_amd64
py34-none-win_amd64
py33-none-win_amd64
py32-none-win_amd64
py31-none-win_amd64
py30-none-win_amd64
cp38-none-any
py38-none-any
py3-none-any
py37-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
此为适用的包的版本
换一个匹配的JPype的whl版本文件进行安装,即可安装成功