0

Referring to ArcGIS help it seems possible to check out advanced desktop license. But typing arcpy.CheckOutExtension('ArcInfo')

gives

Unrecognized extension code ArcInfo

2
  • 4
    The documentation you cite states that it is required to import arcinfo before import arcpy to checkout that product (which is not an extension).
    – Vince
    Commented Dec 22, 2014 at 6:25
  • you can try... arcpy.ProductInfo()
    – user43248
    Commented Dec 22, 2014 at 13:35

2 Answers 2

2

As the documentation states:

"SetProduct is a legacy; importing modules needs to be done before importing arcpy".

http://resources.arcgis.com/en/help/main/10.2/index.html#/SetProduct/03q30000000v000000/

The script might go something like this:

import arcinfo  
import arcpy

if arcpy.CheckProduct("ArcInfo") == "Available":  
    execute code  
else:  
    print "Error message"
2
  • Mr. Che -- This should be the excepted answer. "Explicit is better than implicit. Simple is better than complex." Commented Aug 16, 2015 at 18:08
  • @JohnC.King As you wish. =) Commented Mar 27, 2020 at 4:23
2

Your issue stems from the fact that ArcInfo isn't an extension.

Try using:

arcpy.SetProduct('arcInfo')

It is customary to use a Try:Except block when setting a product level.

Try using:

class LicenseException(Exception):
    pass

try:  
    status = arcpy.SetProduct('arcInfo')
    if status == 'CheckedOut':
        pass
    if status == 'AlreadyInitialized':
        pass
    if status == 'NotLicensed':
        raise LicenseException(status)    # Extends Exception
    if status == 'Failed':
        raise LicenseException(status)

except LicenseException:
    # Handle the exception accordingly.
except:
    # Handle unexpected exceptions.

Look here for more information: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/SetProduct/000v0000003w000000/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.