def check_dependency(module):
 try:
  mod = __import__(module)
 except Exception as e:
  Error(('Module %s failed to load! (%s)' % (module, e)))
  return False
 return True

def check_dependency ( module ) : try : mod = __import__ ( module ) except Exception as e : Error ( ( 'Module %s failed to load! (%s)' % ( module , e ) ) ) return False return True
attempts to load the module; returns a boolean indicating success or fail .