def get_pil_version():
 try:
  __import__('PIL', fromlist=[str('Image')])
  return (0,)
 except ImportError:
  return None

def get_pil_version ( ) : try : __import__ ( 'PIL' , fromlist = [ str ( 'Image' ) ] ) return ( 0 , ) except ImportError : return None
return image magick version or none if it is unavailable try importing pil .