#NEWLINE# def check_if_exists( self ) : #NEWLINE# #INDENT# 'Find an installed distribution that satisfies or conflicts\n        with this requirement, and set self.satisfied_by or\n        self.conflicts_with appropriately.' #NEWLINE# if ( self . req is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . satisfied_by = pkg_resources . get_distribution ( self . req ) #NEWLINE# #UNINDENT# except pkg_resources . DistributionNotFound : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# except pkg_resources . VersionConflict : #NEWLINE# #INDENT# existing_dist = pkg_resources . get_distribution ( existing_dist . req . project_name ) #NEWLINE# if self . use_user_site : #NEWLINE# #INDENT# if dist_in_usersite ( existing_dist ) : #NEWLINE# #INDENT# self . conflicts_with = existing_dist #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( running_under_virtualenv ( ) and dist_in_site_packages ( existing_dist ) ) : #NEWLINE# #INDENT# raise InstallationError ( ( 'Will not install to the user site because it will lack sys.path precedence to %s in %s' % ( existing_dist . project_name , existing_dist . location ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . conflicts_with = existing_dist #NEWLINE# #UNINDENT# #UNINDENT# return True