Failed to execute (CellStatistics) despite running it 5 seconds before

47
0
06-02-2020 04:12 PM
Highlighted
New Contributor

I have a code that, among other things, sums a list of rasters (call it sumFeatures.py). I have run this tool in my code with up to 1000 input rasters (the limit I believe) without ever any problems:

   import arcpy

   arcpy.env.overwriteOutput = True
   arcpy.CheckOutExtension("Spatial")

   arcpy.gp.CellStatistics_sa(";".join(rastersList), outSumRaster, "SUM", "DATA")

In a different python script (call it iterate_sumFeatures.py), I am iterating through a list, preparing some input data and then calling my other code that uses the CellStatistics function. In the first iteration that calls sumFeatures.py --> CellStatistics, it runs just fine. But the next time it tries it, it gives me this error:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000824: The tool is not licensed.
Failed to execute (CellStatistics).

I have the Advanced license. All of the rasters in rastersList exist, the folder where outSumRaster belongs exists. I'm not sure why this is failing when it has worked so many times before (and even in the same exact code in the iteration before).

I thought maybe something was wrong with this particular iteration, so I skipped it, and now the next iteration is throwing the same error.

Any ideas?

Reply
0 Kudos
0 Replies