What is the recommended way getting hold of the package version of a package in the $PYTHONPATH or sys.path? I remember that the pkg_resource module has some functionality for this but I can not find any related information. Please don't point me to solution using a version.py file and reading it somehow. Using pkg_resources is the way to go but how exactly?
>>> import pkg_resources
>>> pkg_resources.get_distribution("PIL").version
'1.1.7'