7

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!)

I was hoping anyone else has a workaround/fix? Thank you for your time!

I have installed 10.1 Service Pack 1. I have checked and enabled all the extensions. Furthermore, I have the advanced ArcInfo version.

  • 2
    You can have ArcGIS for Desktop Advanced without Spatial Analyst being licensed - have you checked to see whether your organisation has purchased and been licensed for Spatial Analyst? – PolyGeo Mar 11 '13 at 2:43
  • Yup, I just checked ArcGIS Administrator to verify that Spatial Analyst indeed has the "yes, Authorized" next to it. Hmph. – michael g Mar 11 '13 at 8:56
  • Is this a standalone script? If so, are you running it as 64-bit or 32-bit? Since you have SP1 installed, it is possible to use either. I have run into situations where one computer would run a 64-bit script while another would not (even though same hardware specs and mirrored installs). – blord-castillo Mar 12 '13 at 20:42
  • Well my computer is 64-bit. But is that 32/64 bit compatibility something sporadic with different systems? I'll try running the script on another computer with GIS... thanks :) – michael g Mar 14 '13 at 22:29
  • What does arcpy.CheckExtension("Spatial") return? – Kirk Kuykendall Mar 20 '13 at 4:15
7

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.

  • For a standalone script it is obligatory to use arcpy.CheckOutExtension("spatial") and arcpy.CheckInExtension("spatial") like yanes proposed while starting the code from Python Window will work without that. arcpy.CheckExtension("Spatial") only returns potential availability status. – EikeMike Mar 20 at 10:18
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
  • it works for mee – Mounaim Mar 5 '14 at 16:07

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.