def is_library_missing(name):
 (path, module) = name.rsplit(u'.', 1)
 try:
  package = import_module(path)
  return (not module_has_submodule(package, module))
 except ImportError:
  return is_library_missing(path)

def is_library_missing ( name ) : ( path , module ) = name . rsplit ( u'.' , 1 ) try : package = import_module ( path ) return ( not module_has_submodule ( package , module ) ) except ImportError : return is_library_missing ( path )
check if library that failed to load cannot be found under any templatetags directory or does exist but fails to import .