How to view PIP dependencies using pipdeptree

When you install a Python PIP package using the pip tool, you will notice that it figures out if the package depends on other packages and installs them too. It is sometimes useful to know what is this tree of packages that a package depends on. pipdeptree is a tool that makes it easy to view this information.

  • Installing pipdeptree is easy:
$ sudo pip3 install pipdeptree
  • View the dependency tree of every installed package
$ pipdeptree
  • View the dependency tree of a particular package foobar:
$ pipdeptree -p foobar
  • View the reverse dependency tree — the packages that are dependent on every installed package:
$ pipdeptree -r
  • Render the dependency tree graph to a PDF file using GraphViz:
$ pipdeptree --graph-output pdf > out.pdf

Tried with: Ubuntu 18.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.