-
-
Save kotnik/516b2cf1a743abad89de to your computer and use it in GitHub Desktop.
Print a list of installed packages and their dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pkg_resources | |
for pkg in pkg_resources.working_set: | |
if pkg.requires(): | |
print '{} => {}'.format(pkg.key, ', '.join(req.project_name for req in pkg.requires())) | |
else: | |
print pkg.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment