0

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

gives

Unrecognized extension code ArcInfo

  • 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 Dec 22 '14 at 6:25
  • you can try... arcpy.ProductInfo() – user43248 Dec 22 '14 at 13:35
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/

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"
  • Mr. Che -- This should be the excepted answer. "Explicit is better than implicit. Simple is better than complex." – John C. King Aug 16 '15 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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