def check_if_exists(self, use_user_site):<EOL>
if self.req is None:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>no_marker = Requirement(str(self.req))<EOL>no_marker.marker = None<EOL>self.satisfied_by = pkg_resources.get_distribution(str(no_marker))<EOL>if self.editable and self.satisfied_by:<EOL><INDENT>self.conflicts_with = self.satisfied_by<EOL>self.satisfied_by = None<EOL>return True<EOL><DEDENT><DEDENT>except pkg_resources.DistributionNotFound:<EOL><INDENT>return False<EOL><DEDENT>except pkg_resources.VersionConflict:<EOL><INDENT>existing_dist = pkg_resources.get_distribution(<EOL>self.req.name<EOL>)<EOL>if 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<EOL>dist_in_site_packages(existing_dist)):<EOL><INDENT>raise InstallationError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(existing_dist.project_name, existing_dist.location)<EOL>)<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.