使用pip列出软件包的依赖项 [英] Listing the dependencies of a package using pip

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

问题描述

如何使用pip列出软件包的依赖关系?

How do I list the dependencies for a package using pip?

推荐答案

请注意,2012年的答案已经过时.首先,解决方法(答案已经说过,您现在应该在2012年不应该这样做),现在您已经不能这样做.如果您想要类似的解决方法,则可以使用pip download,但是您所需的可能性更低.特别是由于改进了pip show.幸运的是,该问题已被标记为后面一个问题的重复,因此,除了出于历史目的之外,没有任何理由阅读此答案.

Note that this answer from 2012 is out of date. First, the workaround, which the answer already said you probably shouldn't do in 2012, now you can't do it. If you want a similar workaround, you could use pip download, but it's even less likely to be what you want. Especially since pip show has been improved. Fortunately, the question has been marked as a dup of a later question, so there's no reason to read this answer except for historical purposes.

您不能,至少不能直接.

You can't, at least not directly.

您可以用自己的代码导入pip模块并下载需求文件,然后对其进行遍历.或者,从命令行,您可以pip install --no-install --verbose.

You can import the pip module in your own code and download the requirements file and then iterate through it. Or, from the command line, you can pip install --no-install --verbose.

但是,实际上,除非需要自动化,否则只需访问 http://pypi .python.org/并在那里搜索包,而不是使用pip.

But really, unless this is something you need to automate, it's probably easier to just go to http://pypi.python.org/ and search for the package there instead of using pip.

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

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