def package_check(pkg_name, version=None, app='pandas', checker=LooseVersion, exc_failed_import=ImportError, exc_failed_check=RuntimeError):
 if app:
  msg = ('%s requires %s' % (app, pkg_name))
 else:
  msg = ('module requires %s' % pkg_name)
 if version:
  msg += (' with version >= %s' % (version,))
 try:
  mod = __import__(pkg_name)
 except ImportError:
  raise exc_failed_import(msg)
 if (not version):
  return
 try:
  have_version = mod.__version__
 except AttributeError:
  raise exc_failed_check(('Cannot find version for %s' % pkg_name))
 if (checker(have_version) < checker(version)):
  raise exc_failed_check(msg)

def package_check ( pkg_name , version = None , app = 'pandas' , checker = LooseVersion , exc_failed_import = ImportError , exc_failed_check = RuntimeError ) : if app : msg = ( '%s requires %s' % ( app , pkg_name ) ) else : msg = ( 'module requires %s' % pkg_name ) if version : msg += ( ' with version >= %s' % ( version , ) ) try : mod = __import__ ( pkg_name ) except ImportError : raise exc_failed_import ( msg ) if ( not version ) : return try : have_version = mod . __version__ except AttributeError : raise exc_failed_check ( ( 'Cannot find version for %s' % pkg_name ) ) if ( checker ( have_version ) < checker ( version ) ) : raise exc_failed_check ( msg )
check that the minimal version of the required package is installed .