def module_exists(module_name):
 try:
  __import__(module_name)
 except ImportError:
  return False
 else:
  return True

def module_exists ( module_name ) : try : __import__ ( module_name ) except ImportError : return False else : return True
check to see if a module is installed or not .