pipdeptree

I was chasing a dependency issue when executing Python code. After much searching and several blind alleys in that search, evidence started to mount that the problem was related to a package dependency not being properly satisfied.

I started using pip show and other commands to piece together the evidence I needed to pinpoint the error. Then I stumbled upon a python tool that does the work for me: pipdeptree.

pip install pipdeptree

Then execute on a package:

[root@jen-master ~]# pipdeptree -p ansible
ansible==2.4.0.0
- cryptography [required: Any, installed: 2.3.1]
- asn1crypto [required: >=0.21.0, installed: 0.24.0]
- cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]
- pycparser [required: Any, installed: 2.19]
- enum34 [required: Any, installed: 1.1.6]
- idna [required: >=2.1, installed: 2.7]
- ipaddress [required: Any, installed: 1.0.22]
- six [required: >=1.4.1, installed: 1.11.0]
- jinja2 [required: Any, installed: 2.10]
- MarkupSafe [required: >=0.23, installed: 1.1.0]
- paramiko [required: Any, installed: 2.4.1]
- bcrypt [required: >=3.1.3, installed: 3.1.4]
- cffi [required: >=1.1, installed: 1.11.5]
- pycparser [required: Any, installed: 2.19]
- six [required: >=1.4.1, installed: 1.11.0]
- cryptography [required: >=1.5, installed: 2.3.1]
- asn1crypto [required: >=0.21.0, installed: 0.24.0]
- cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]
- pycparser [required: Any, installed: 2.19]
- enum34 [required: Any, installed: 1.1.6]
- idna [required: >=2.1, installed: 2.7]
- ipaddress [required: Any, installed: 1.0.22]
- six [required: >=1.4.1, installed: 1.11.0]
- pyasn1 [required: >=0.1.7, installed: 0.4.4]
- pynacl [required: >=1.0.1, installed: 1.3.0]
- cffi [required: >=1.4.1, installed: 1.11.5]
- pycparser [required: Any, installed: 2.19]
- six [required: Any, installed: 1.11.0]
- PyYAML [required: Any, installed: 3.13]
- setuptools [required: Any, installed: 0.9.8]

As you can see, a recursive list of every dependency along with version requirements. Very helpful!

Advertisements