code: def fetch_package_version(dist_name):
      
      try:
          # Importing pkg_resources can be slow, so only import it
          # if we need it.
          import pkg_resources
      except ImportError:
          # pkg_resource is not available on Google App Engine
          raise NotImplementedError('pkg_resources is not available '
                                    'on this Python install')
      dist = pkg_resources.get_distribution(dist_name)
      return dist.version
docs: >>> fetch_package_version('sentry')