栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

查看本机电脑wheel可安装版本号

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

查看本机电脑wheel可安装版本号

第一种,在终端或cmd中输入
python -m pip debug --verbose

显示结果如下:

(base) PS C:Userstiger> 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 21.2.4 from D:ProgramDataAnaconda3libsite-packagespip (python 3.9)
sys.version: 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
sys.executable: D:ProgramDataAnaconda3python.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(): D:ProgramDataAnaconda3libsite-packagespip_vendorcertificacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
  appdirs==1.4.4
  CacheControl==0.12.6
  colorama==0.4.4
  distlib==0.3.2
  distro==1.5.0 (Unable to locate actual module version, using vendor.txt specified version)
  html5lib==1.1
  msgpack==1.0.2 (Unable to locate actual module version, using vendor.txt specified version)
  packaging==21.0
  pep517==0.11.0
  progress==1.5
  pyparsing==2.4.7
  requests==2.26.0
  certifi==2021.05.30
  chardet==4.0.0
  idna==3.2
  urllib3==1.26.6
  resolvelib==0.7.1
  setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)
  six==1.16.0
  tenacity==8.0.1 (Unable to locate actual module version, using vendor.txt specified version)
  tomli==1.0.3
  webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 33
  cp39-cp39-win_amd64
  cp39-abi3-win_amd64
  cp39-none-win_amd64
  cp38-abi3-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
  py39-none-win_amd64
  py3-none-win_amd64
  py38-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
  cp39-none-any
  py39-none-any
  py3-none-any
  py38-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: 33后即为可以安装对应whl文件版本。

第二种:
win32常用:
import pip;
print(pip.pep425tags.get_supported())

amd64常用:
import pip._internal
print(pip._internal.pep425tags.get_supported())
或
import pip._internal.pep425tags
print(pip._internal.pep425tags.get_supported())
或
import wheel.pep425tags as w
print(w.get_supported("archive_root"))

但由于pip版本和wheel版本问题,会导致报错。
报错如下:

Traceback (most recent call last):

  File "C:UserstigerAppDataLocalTemp/ipykernel_98740/2520985485.py", line 1, in 
    print(pip._internal.wheel_builder.get_wheel_distribution())

TypeError: get_wheel_distribution() missing 2 required positional arguments: 'wheel_path' and 'canonical_name'

-------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):

  File "C:UserstigerAppDataLocalTemp/ipykernel_98740/1929971253.py", line 1, in 
    print(pip.pep425tags.get_supported())

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

解决办法
换个有这个的pip版本或wheel版本

参考:
https://blog.csdn.net/weixin_44035267/article/details/108257148

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/929732.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号