ERROR

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

Last Published: February 6, 2025

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

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options