Check python package version in program

#Python

Table of Contents

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,
\\ http://stackoverflow.com/questions/710609/checking-python-module-version-at-runtime\\

1>>> pkg_resources.get_distribution('web.py')
2web.py 0.37 (/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg)

\\

To get just the version, you can do

\\

1>>> pkg_resources.get_distribution('web.py').version
2'0.37'