8

I try to run the Zonal Statistic as a Table through ArcPy and it gives me:

ERROR 000824: The tool is not licensed.

Here is the doc for the function: http://resources.arcgis.com/en/help/main/10.1/index.html#//009z000000w8000000

I have tried including the line where it checks for my Spatial Analyst extension:

arcpy.CheckOutExtension("Spatial")

but that just leaves the script running for a long time, way longer than it should (10 minutes+ on a 250Mb raster!)

Do you have a workaround/fix?

I have installed 10.1 Service Pack 1. I have checked and enabled all the extensions.

Furthermore, I have the Advanced/ArcInfo license level.

0

2 Answers 2

10

Wrap the part of your code that needs Spatial Analyst extension as follows

arcpy.CheckOutExtension("spatial")

#your code

arcpy.CheckInExtension("spatial")

By checking out licenses only when you need them and checking them in, you won't hold up licences if other people need to use them. This is useful in a setting where there are fewer licenses than the people who use them in a network environment.

0
2

You may need to import the arcinfo module for the script to be able to use the spatial analyst extension. Your import statement at the beginning of your script should look like this:

import arcpy, arcinfo
0

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.