Created
April 15, 2014 21:07
-
-
Save ccorcos/10774818 to your computer and use it in GitHub Desktop.
how to check for a python package version at runtime
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 | |
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