Listing the dependencies of a package using pip [d

2019-01-22 10:59发布

This question already has an answer here:

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

标签: python pip
2条回答
够拽才男人
2楼-- · 2019-01-22 11:14

In current pip (version 1.3.1) you can see the dependencies of an installed package by using:

pip show <package>
查看更多
姐就是有狂的资本
3楼-- · 2019-01-22 11:18

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.

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.

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.

查看更多
登录 后发表回答