使用Python和pip列出可用的软件包的所有版本? [英] Python and pip, list all versions of a package that's available?

查看:589
本文介绍了使用Python和pip列出可用的软件包的所有版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出可以通过 pip 安装的Python软件包的名称,办法找出点子可能会安装的所有可能版本的列表?现在是反复试验.

Given the name of a Python package that can be installed with pip, is there any way to find out a list of all the possible versions of it that pip could install? Right now it's trial and error.

我正在尝试为第三方库安装一个版本,但是最新版本太新了,进行了向后不兼容的更改.因此,我想以某种方式列出pip知道的所有版本,以便我可以对其进行测试.

I'm trying to install a version for a third party library, but the newest version is too new, there were backwards incompatible changes made. So I'd like to somehow have a list of all the versions that pip knows about, so that I can test them.

推荐答案

(更新:截至2020年3月,许多人报告说,通过pip install yolk3k安装的蛋黄只能返回最新版本.

(update: As of March 2020, many people have reported that yolk, installed via pip install yolk3k, only returns latest version. Chris's answer seems to have the most upvotes and worked for me)

pastebin上的脚本可以正常工作.但是,如果您要使用多个环境/主机,这不是很方便,因为您每次都必须复制/创建它.

The script at pastebin does work. However it's not very convenient if you're working with multiple environments/hosts because you will have to copy/create it every time.

更好的全方位解决方案是使用 yolk3k ,该软件可以安装用点子.例如.查看可用的Django版本:

A better all-around solution would be to use yolk3k, which is available to install with pip. E.g. to see what versions of Django are available:

$ pip install yolk3k
$ yolk -V django
Django 1.3
Django 1.2.5
Django 1.2.4
Django 1.2.3
Django 1.2.2
Django 1.2.1
Django 1.2
Django 1.1.4
Django 1.1.3
Django 1.1.2
Django 1.0.4

yolk3k是原始 yolk 的分支,该版本停止了 2012 .尽管不再维护yolk(如下面的注释所示),但yolk3k似乎仍然存在并支持Python 3.

yolk3k is a fork of the original yolk which ceased development in 2012. Though yolk is no longer maintained (as indicated in comments below), yolk3k appears to be and supports Python 3.

注意::我没有参与yolk3k的开发. 如果某些事情似乎无法正常工作,在此处发表评论也不会有太大改变.使用 yolk3k问题跟踪器,并考虑提交修补程序.

Note: I am not involved in the development of yolk3k. If something doesn't seem to work as it should, leaving a comment here should not make much difference. Use the yolk3k issue tracker instead and consider submitting a fix, if possible.

这篇关于使用Python和pip列出可用的软件包的所有版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆