ERROR

TypeError: CalculateGeometryAttributes() takes from 0 to 5 positional arguments but 6 were given

Last Published: September 9, 2020

Error Message

When running the Calculate Geometry Attributes tool in a Python script, the following error may be returned: 

TypeError: CalculateGeometryAttributes() takes from 0 to 5 positional arguments but 6 were given.

Cause

Prior to ArcGIS Pro 2.5, the Calculate Geometry Attributes tool only accepted 5 parameters: 

in_features, geometry_property, {length_unit}, {area_unit}, {coordinate_system}

After the release of ArcGIS Pro 2.5., the tool now accepts 6 parameters: 

in_features, geometry_property, {length_unit}, {area_unit}, {coordinate_system}, {coordinate_format}

When running the following line of code it is possible to find out how many parameters the tool accepts with the version in use: 

arcpy.management.CalculateGeometryAttributes.__code__.co_argcount

Solution or Workaround

Upgrade to ArcGIS Pro 2.5. or later. 

Article ID: 000023718

Software:
  • ArcGIS Pro 1 x
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options