Been running into this issue for a while now, and previously I just did a big multi step work around, but now it is just getting annoying to have to keep doing that within the code. I simply get this error:
Traceback (most recent call last):
File "C:\Users\USERNAME\GIS Share Drive\_Resources\Toolboxes\Toolbox.atbx\ToolName.tool\tool.script.execute.py", line 26, in <module>
ModuleNotFoundError: No module named 'common'
Here is the portion of the code we get hung up on:
# Process: Summarize Within (Summarize Within) (analysis)
arcpy.AddMessage(f"Generate crop history summary table.")
Crop_Summary = f"{OutputLocation}\\Crop_{Year}_Summary"
Class_Names_Summary = f"{OutputLocation}\\Crop_{Year}_Class_Names_Summary"
arcpy.analysis.SummarizeWithin(in_polygons=Field_Boundary,
in_sum_features=Crop_poly,
out_feature_class=Crop_Summary,
keep_all_polygons="KEEP_ALL",
sum_fields=[['gridcode','SUM']],
sum_shape="ADD_SHAPE_SUM",
shape_unit="ACRES",
group_field="Class_Names",
add_min_maj="ADD_MIN_MAJ",
add_group_percent="ADD_PERCENT",
out_group_table=Class_Names_Summary)
We have reviewed all out output locations, types, and inputs and everything works as expected when running those through the tool in the traditional GUI. However, since this is just 1 step in a larger process we want it in our custom script tool.
Any help would be MUCH appreciated.