Skip to content

Instantly share code, notes, and snippets.

@prehensilecode
Last active September 12, 2017 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prehensilecode/8b574f5d3b8c582d3443d9230c0bc63c to your computer and use it in GitHub Desktop.
Save prehensilecode/8b574f5d3b8c582d3443d9230c0bc63c to your computer and use it in GitHub Desktop.
Query a module version programmatically using pip
import pip
# get installed modules (aka "distributions")
for m in pip.get_installed_distributions():
print(m.version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment