Saturday, March 30, 2013

Check python package version in program

I have always wanted to check the version of the python packages which I am using. Today I found a way to find that.

As stated here,
>>> pkg_resources.get_distribution('') 0.37 (/usr/local/lib/python2.7/dist-packages/

To get just the version, you can do

>>> pkg_resources.get_distribution('').version

No comments: