def addsitepackages(known_paths):
 sitedirs = []
 seen = []
 for prefix in PREFIXES:
  if ((not prefix) or (prefix in seen)):
   continue
  seen.append(prefix)
  if (sys.platform in ('os2emx', 'riscos')):
   sitedirs.append(os.path.join(prefix, 'Lib', 'site-packages'))
  elif (os.sep == '/'):
   sitedirs.append(os.path.join(prefix, 'lib', ('python' + sys.version[:3]), 'site-packages'))
   sitedirs.append(os.path.join(prefix, 'lib', 'site-python'))
  else:
   sitedirs.append(prefix)
   sitedirs.append(os.path.join(prefix, 'lib', 'site-packages'))
  if (sys.platform == 'darwin'):
   if ('Python.framework' in prefix):
    sitedirs.append(os.path.expanduser(os.path.join('~', 'Library', 'Python', sys.version[:3], 'site-packages')))
 for sitedir in sitedirs:
  if os.path.isdir(sitedir):
   addsitedir(sitedir, known_paths)
 return known_paths

def addsitepackages ( known_paths ) : sitedirs = [ ] seen = [ ] for prefix in PREFIXES : if ( ( not prefix ) or ( prefix in seen ) ) : continue seen . append ( prefix ) if ( sys . platform in ( 'os2emx' , 'riscos' ) ) : sitedirs . append ( os . path . join ( prefix , 'Lib' , 'site-packages' ) ) elif ( os . sep == '/' ) : sitedirs . append ( os . path . join ( prefix , 'lib' , ( 'python' + sys . version [ : 3 ] ) , 'site-packages' ) ) sitedirs . append ( os . path . join ( prefix , 'lib' , 'site-python' ) ) else : sitedirs . append ( prefix ) sitedirs . append ( os . path . join ( prefix , 'lib' , 'site-packages' ) ) if ( sys . platform == 'darwin' ) : if ( 'Python.framework' in prefix ) : sitedirs . append ( os . path . expanduser ( os . path . join ( '~' , 'Library' , 'Python' , sys . version [ : 3 ] , 'site-packages' ) ) ) for sitedir in sitedirs : if os . path . isdir ( sitedir ) : addsitedir ( sitedir , known_paths ) return known_paths
add site-packages to sys .