def get_installed_version(dist_name, lookup_dirs=None):
 req = pkg_resources.Requirement.parse(dist_name)
 if (lookup_dirs is None):
  working_set = pkg_resources.WorkingSet()
 else:
  working_set = pkg_resources.WorkingSet(lookup_dirs)
 dist = working_set.find(req)
 return (dist.version if dist else None)

def get_installed_version ( dist_name , lookup_dirs = None ) : req = pkg_resources . Requirement . parse ( dist_name ) if ( lookup_dirs is None ) : working_set = pkg_resources . WorkingSet ( ) else : working_set = pkg_resources . WorkingSet ( lookup_dirs ) dist = working_set . find ( req ) return ( dist . version if dist else None )
get the installed version of dist_name avoiding pkg_resources cache .