Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pip show" command should display reverse dependencies / "pip graph" new command #4968

Open
lepetitchevalblanc opened this issue Jan 17, 2018 · 1 comment
Labels
C: list/show 'pip list' or 'pip show' type: feature request Request for a new feature

Comments

@lepetitchevalblanc
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating system: All

Description:

This is a feature request, I think.
It would be nice to, at least, get a list of reverse dependencies with a "pip show <package_name>" command, with a depth of 1 for an installed package.
Maybe a better approach is to create a new command, e.g. "pip graph <package_name>" to show a complete tree of dependencies of an installed package.

What I've run:

As a workaround, I use this script from https://stackoverflow.com/questions/21336323/show-reverse-dependencies-with-pip:

# rev_deps.py
import pip
import sys

def find_reverse_deps(package_name):
    return [
        pkg.project_name for pkg in pip.get_installed_distributions()
        if package_name in {req.project_name for req in pkg.requires()}
    ]

if __name__ == '__main__':
    print find_reverse_deps(sys.argv[1])

Thanks for your work on pip :-)

@lepetitchevalblanc lepetitchevalblanc changed the title "pip show" command should display reverse dependencies / pip "graph new" command "pip show" command should display reverse dependencies / "pip graph" new command Jan 17, 2018
@pradyunsg pradyunsg added the type: feature request Request for a new feature label Jan 19, 2018
@xavfernandez xavfernandez added the C: list/show 'pip list' or 'pip show' label Jul 4, 2018
@stas00
Copy link

stas00 commented Oct 19, 2018

I found this one to work:

pipdeptree --reverse --packages PACKAGENAME

https:/naiquevin/pipdeptree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: list/show 'pip list' or 'pip show' type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants