def check_if_exists(self):
if self.req is None:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>self.satisfied_by = pkg_resources.get_distribution(self.req)<EOL><DEDENT>except pkg_resources.DistributionNotFound:<EOL><INDENT>return False<EOL><DEDENT>except pkg_resources.VersionConflict:<EOL><INDENT>existing_dist = pkg_resources.get_distribution(self.req.project_name)<EOL>if self.use_user_site:<EOL><INDENT>if dist_in_usersite(existing_dist):<EOL><INDENT>self.conflicts_with = existing_dist<EOL><DEDENT>elif running_under_virtualenv() and dist_in_site_packages(existing_dist):<EOL><INDENT>raise InstallationError("<STR_LIT>"<EOL>%(existing_dist.project_name, existing_dist.location))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.conflicts_with = existing_dist<EOL><DEDENT><DEDENT>return True<EOL>
Find an installed distribution that satisfies or conflicts
        with this requirement, and set self.satisfied_by or
        self.conflicts_with appropriately.