1

I'm trying to execute a standalone python script using arcpy and spatial analyst extension. I've arcmap installed with a trial license.

The script is the following:

import arcpy,arcinfo
import sys
import os

def listFcsInGDB(dataset):
    ''' List all Feature Classes in a geodatabase, including inside Feature Datasets '''
    fcs = []
    for fds in arcpy.ListDatasets('','feature') + ['']:
        if (fds == dataset):
            for fc in arcpy.ListFeatureClasses('','',fds):
                fcs.append(os.path.join(fds, fc))
    return fcs

if arcpy.CheckProduct("ArcInfo") == "Available":
   print "available"

if arcpy.CheckExtension("Spatial") == "Available":
    arcpy.CheckOutExtension("Spatial")
    print "License is available"


arcpy.env.workspace = "C:\\Users\\user\\\Desktop\\input.gdb"

fcs = listFcsInGDB("SPlit")

for fc in fcs:
    try:
        logFile = open('Log.txt', 'a+')
        logFile.write("Create TIN...\n")
        # Process: Create TIN
        outputFC = fc+"_TIN"
        arcpy.CreateTin_3d(outputFC,
                       "PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]]",
                       fc,
                       "DELAUNAY")
        logFile.write("TIN successfully created. Output FC: " + outputFC + "\n")
        logFile.close()

...

When I run the script on my machine, i get the error "ERROR 000824: The tool is not licensed", while running the same script on another machine with a regular license does not return any error.

The script prints "License is available" and running the createTin tool from arcmap does not return any error.

I think the issue is due to the fact that I have old expired trial licenses registered in arcGis administrator, and my standalone script is not able to retrieve the correct (unexpired) license. Does this make sense? How can I make it work?

  • 1
    You're using a 3D Analyst tool, so why do you check out Spatial Analyst? – GISGe Jul 15 '16 at 10:03
  • Thanks, that was the error...but why it works if I run the script from the other machine? – user1071138 Jul 15 '16 at 10:28
  • 1
    These licensing functions are for concurrent use licenses managed by a License Manager, not for single use licenses managed by the ArcGIS Administrator (like your trial license). Your script is using the CU licenses from the LM. You should check how licenses are set on every machine to explain the different behaviour. – GISGe Jul 15 '16 at 10:47