Listing the dependencies of a package using pip

PythonPip

Python Problem Overview


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

Python Solutions


Solution 1 - Python

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

pip show <package>

Solution 2 - Python

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjanView Question on Stackoverflow
Solution 1 - PythonkdbView Answer on Stackoverflow
Solution 2 - PythonabarnertView Answer on Stackoverflow