def distribution_version(name):
from pkg_resources import get_distribution, DistributionNotFound<EOL>try:<EOL><INDENT>dist = get_distribution(name)<EOL><DEDENT>except DistributionNotFound:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>return dist.version<EOL><DEDENT>
try to get the version of the named distribution,
    returs None on failure