def CheckInstalledVersion(name, desired, explicit):
 CallSetAllowedModule(name, desired)
 find_version = PACKAGES[name][0]
 if (name == 'django'):
  global _DESIRED_DJANGO_VERSION
  _DESIRED_DJANGO_VERSION = ('v' + desired.replace('.', '_'))
 installed_version = find_version()
 try:
  desired_version = distutils.version.LooseVersion(desired)
 except AttributeError:
  desired_version = LooseVersion.parse(desired)
 if (not EqualVersions(installed_version, desired_version)):
  raise UnacceptableVersionError(('%s %s was requested, but %s is already in use' % (name, desired_version, installed_version)))
 installed[name] = (desired, explicit)

def CheckInstalledVersion ( name , desired , explicit ) : CallSetAllowedModule ( name , desired ) find_version = PACKAGES [ name ] [ 0 ] if ( name == 'django' ) : global _DESIRED_DJANGO_VERSION _DESIRED_DJANGO_VERSION = ( 'v' + desired . replace ( '.' , '_' ) ) installed_version = find_version ( ) try : desired_version = distutils . version . LooseVersion ( desired ) except AttributeError : desired_version = LooseVersion . parse ( desired ) if ( not EqualVersions ( installed_version , desired_version ) ) : raise UnacceptableVersionError ( ( '%s %s was requested, but %s is already in use' % ( name , desired_version , installed_version ) ) ) installed [ name ] = ( desired , explicit )
check that the installed version of a package is acceptable .