TypeError and AttributeError when executing SummarizeWithin (ArcPy)

452
5
04-23-2020 07:02 AM
MarkusBenninghoff
New Contributor II

I'm using the SummarizeWithin tool with arcpy, running in a Jupyter Notebook.

sum_fields = "TOTAL Sum;M_TOTAL Sum;F_TOTAL Sum"
arcpy.analysis.SummarizeWithin("counties", "demographics", "counties_demo", '', sum_fields)‍‍‍

On execution I receive a lot of these two errors in the console.

TypeError: setGroupParams() missing 2 required positional arguments: 'groupFieldName' and 'fcPath'
AttributeError: 'ToolValidator' object has no attribute 'isLicensed'‍‍

The tool runs through and gives a correct output FeatureClass. I still would like to get rid of these errors.

When executed as a regular Geoprocessing Tool in ArcGIS 2.5 no errors are reported, same when the code snippet is run in the Python Console.

Is this a bug, or am I doing something wrong?

0 Kudos
5 Replies
JoshuaBixby
MVP Esteemed Contributor

If it works in the Pro GUI and Python console, and it gives correct results in Jupyter, it is likely a defect related to Jupyter integration.  Personally, if it works, I wouldn't waste the time chasing it down.  If it really bugs you, open a case with Esri Support to log a defect.

MarkusBenninghoff
New Contributor II

It also does not work att all within PyCharm (linked with default arcgispro-py3 environment). Here it returns a Error 999999:

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Traceback (most recent call last):
  File "C:/EsriTraining/PYTS/Scripts/SummarizeWithinTest.py", line 15, in <module>
    arcpy.analysis.SummarizeWithin(mkfn, rkfn, mkrkPolyFc, '', sum_fields)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 2299, in SummarizeWithin
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 2296, in SummarizeWithin
    retval = convertArcObjectToPythonObject(gp.SummarizeWithin_analysis(*gp_fixargs((in_polygons, in_sum_features, out_feature_class, keep_all_polygons, sum_fields, sum_shape, shape_unit, group_field, add_min_maj, add_group_percent, out_group_table), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 511, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))

Yes, the error in Jupyter-Notebook is more a cosmetic issue.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Are you running the jupyter notebook with Pro? or external to it?

0 Kudos
MarkusBenninghoff
New Contributor II

I'm running an external version of jupyter notebook on a cloned arcgispro-py3 environment.

0 Kudos
JohannesMitterer
New Contributor

I receive the same error messages using Spyder 3 and ArcGIS Pro 2.5 on a cloned ArcGIS Pro-py3 environment. I have to wait to update ArcGIS Pro to recent version 2.7 and Spyder 3 to 4 until a project is finished. Maybe the problem is solved in recent releases?

0 Kudos