I am trying to run this tool, Split By Attributes, in a Python script, and it keeps telling me that it's not licensed.
The page says it's available for all levels of ArcGIS Desktop (I am running Standard).
I am not sure why it's throwing this error. Any idea on how to get around this?
Solved! Go to Solution.
"Failed to execute (Frequency)."
I'm wondering if Split Layer by Attribute is dependant on the Frequency Geoprocessing Tool, which is an advanced only license, therefore causing the script to fail.
http://pro.arcgis.com/en/pro-app/tool-reference/analysis/frequency.htm
Dan_Patterson, bixb0012, someone smarter than me have any idea on this?
What version of ArcMap are you running?
ArcMap 10.5
You can check to see if your code is pulling a license and what license level using the licensing functions. You can also manually set your license level for the script using this.
http://desktop.arcgis.com/en/arcmap/latest/analyze/python/access-to-licensing-and-extensions.htm
You mind posting your code as well?
import os
import arceditor
import arcpy
print arcpy.CheckProduct("ArcEditor")
arcpy.env.workspace = r"G:\user\Final Parcels\/"
print "************** STARTING ********************"
arcpy.SplitByAttributes_analysis("G:\user\Test Publishing.gdb\SmallParcels", "G:\user\Small Parcel SHPs", "SectionName")
Here's the relevant piece of my Python code. It fails as soon as it gets to SplitByAttributes. It returns "Available" when running CheckProduct.
Also, here's the error I get when it fails.
ERROR 000824: The tool is not licensed.
Failed to execute (Frequency).
Failed to execute (SplitByAttributes).
"Failed to execute (Frequency)."
I'm wondering if Split Layer by Attribute is dependant on the Frequency Geoprocessing Tool, which is an advanced only license, therefore causing the script to fail.
http://pro.arcgis.com/en/pro-app/tool-reference/analysis/frequency.htm
Dan_Patterson, bixb0012, someone smarter than me have any idea on this?
I just looked through the code of the Split By Attributes script, and it is indeed calling the Frequency GP tool.
I wonder why they would say that Split By Attribute is available for all levels, when you can't run it without Frequency...
You might have to go old school... SplitLayerByAttributes
has worked for quite a while, if you follow the rules about what is accepted as inputs and outputs.
And really.... Frequency should be standard, hence
was also written as part of the movement to make standard esential tools available at all license levels
Thanks for posting the link, I was digging through old threads and couldn't find it, but found lots of old broken ones...
But yea, I guess its just ESRI Logic to put a tool at all license levels that is dependent on a license restricted tool to function.
Dan, thanks for your help on this.
Is there a standalone script available for your SplitLayerByAttributes? Or, would I be able to go in and change it to work in standalone mode?
I have some other pieces that I am trying to work into my full Python script, so I kind of need something to run completely outside of ArcMap.