def module_not_available(module):
 try:
  mod = import_module(module)
  mod_not_avail = False
 except ImportError:
  mod_not_avail = True
 return mod_not_avail

def module_not_available ( module ) : try : mod = import_module ( module ) mod_not_avail = False except ImportError : mod_not_avail = True return mod_not_avail
can module be imported? returns true if module does not import .