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

查看:26
本文介绍了使用 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天全站免登陆