def getsitepackages():
 sitepackages = []
 seen = set()
 for prefix in PREFIXES:
  if ((not prefix) or (prefix in seen)):
   continue
  seen.add(prefix)
  if (sys.platform in ('os2emx', 'riscos')):
   sitepackages.append(os.path.join(prefix, 'Lib', 'site-packages'))
  elif (os.sep == '/'):
   sitepackages.append(os.path.join(prefix, 'lib', ('python' + sys.version[:3]), 'site-packages'))
   sitepackages.append(os.path.join(prefix, 'lib', 'site-python'))
  else:
   sitepackages.append(prefix)
   sitepackages.append(os.path.join(prefix, 'lib', 'site-packages'))
  if (sys.platform == 'darwin'):
   from sysconfig import get_config_var
   framework = get_config_var('PYTHONFRAMEWORK')
   if framework:
    sitepackages.append(os.path.join('/Library', framework, sys.version[:3], 'site-packages'))
 return sitepackages

def getsitepackages ( ) : sitepackages = [ ] seen = set ( ) for prefix in PREFIXES : if ( ( not prefix ) or ( prefix in seen ) ) : continue seen . add ( prefix ) if ( sys . platform in ( 'os2emx' , 'riscos' ) ) : sitepackages . append ( os . path . join ( prefix , 'Lib' , 'site-packages' ) ) elif ( os . sep == '/' ) : sitepackages . append ( os . path . join ( prefix , 'lib' , ( 'python' + sys . version [ : 3 ] ) , 'site-packages' ) ) sitepackages . append ( os . path . join ( prefix , 'lib' , 'site-python' ) ) else : sitepackages . append ( prefix ) sitepackages . append ( os . path . join ( prefix , 'lib' , 'site-packages' ) ) if ( sys . platform == 'darwin' ) : from sysconfig import get_config_var framework = get_config_var ( 'PYTHONFRAMEWORK' ) if framework : sitepackages . append ( os . path . join ( '/Library' , framework , sys . version [ : 3 ] , 'site-packages' ) ) return sitepackages
returns a list containing all global site-packages directories .