Spatial Analysis License Unavailable or Disabled After Python script:  Error 010096

3587
2
08-29-2012 02:00 PM
SueClark
New Contributor II
I get an Error 010096 when I try to use the Zonal Statistics As Table system tool after running a custom tool that I wrote.  The tool I wrote uses the arcpy version of Zonal Statistics as Table.  I have to turn off then on the Spatial Analyst extension (under Customize->Extension) to get the tool to work again.  Is there anyway to turn the extension back on in my tool? 

I'm running ArcGIS 10 for Desktop, so I'm the only one using the extensions.  I check the extension out and in inside my script.  I've tried deleting variables and doing garbage collection, but I still have the problem.  I can run my tool multiple times in my row; however, I can't run the Zonal Statistics as Table system tool without first turning off then on the spatial analyst.

You can look at the whole tool, http://www.arcgis.com/home/item.html?id=b859b33c616a47d2b99b5e133942db02
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus
are you using the checkoutextension code in the script?
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003q000000
to save me downloading it?
0 Kudos
SueClark
New Contributor II
Yes, I'm using CheckOutExtension.  When I'm all done I do a CheckInExtension.

The tool runs without error.

Thanks!
0 Kudos