I am trying to use the Split by Attributes tool in arcpy to split a shapefile with 18 point features into 18 separate shapefiles. It works as expected in ArcGIS Pro, but when I run the following script, I get the error: arcgisscripting.ExecuteError: 'str' object has no attribute 'polygon'
import arcpy arcpy.env.overwriteOutput = True inputfc = r'C:\Users\Ian\Documents\ArcGIS\GIS test data\SJemezNamedSites.shp' fieldname = 'short_name' target_workspace = r'C:\Users\Ian\Documents\ArcGIS\GIS test data\output' arcpy.SplitByAttributes_analysis(inputfc, target_workspace, fieldname)
Additionally, if I run the tool from ArcGIS Pro, and then choose to "Copy Python Command", I get:
arcpy.analysis.SplitByAttributes(r"C:\Users\Ian\Documents\ArcGIS\GIS test data\SJemezNamedSites.shp", r"C:\Users\Ian\Documents\ArcGIS\GIS test data\output", "short_name")
If I simply run that script, I get the same error as I do with my script. What am I doing wrong?
I am using ArcGIS Pro 1.3.1, arcpy with python 3, and writing my script in pycharm IDE