Skip to content

Instantly share code, notes, and snippets.

@ccorcos
Created April 15, 2014 21:07
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 ccorcos/10774818 to your computer and use it in GitHub Desktop.
Save ccorcos/10774818 to your computer and use it in GitHub Desktop.
how to check for a python package version at runtime
import pkg_resources
def version(packageName):
return pkg_resources.get_distribution(packageName).version
package = "matplotlib"
print package + ": " + version(package)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment