赞
踩
运行下面的代码即可:
import json from urllib import request from pkg_resources import parse_version import ssl ssl._create_default_https_context = ssl._create_unverified_context def versions(pkg_name): url = f'https://pypi.python.org/pypi/{pkg_name}/json' releases = json.loads(request.urlopen(url).read())['releases'] return sorted(releases, key=parse_version, reverse=True) if __name__ == '__main__': # name = input() # 这个可以接收输入 name = "pandas" # 这是要查询的库名称 print("正在查询:{}".format(name)) value_list = versions(name) print(value_list)
使用pypi
使用pip >= 20.3:
pip install --use-deprecated=legacy-resolver pandas==
或pip >= 21.1:
pip install pandas==
yolk3k(目前已不再支持)
yolk3k安装方法:
pip install yolk3k
yolk3k文档 & pypi地址:https://pypi.org/project/yolk3k/
使用方法:
import ssl
import os
ssl._create_default_https_context = ssl._create_unverified_context
os.system("yolk -V pandas")
Python and pip, list all versions of a package that’s available?:https://stackoverflow.com/questions/4888027/python-and-pip-list-all-versions-of-a-package-thats-available?rq=1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。