def is_lib_available(library):
 try:
  __import__(library)
  return True
 except ImportError:
  return False

def is_lib_available ( library ) : try : __import__ ( library ) return True except ImportError : return False
check if a python library is available .