AnsweredAssumed Answered

AttributeError: DescribeData: Method fieldInfo does not exist

Question asked by jbridwell_Dewberry on Aug 3, 2018
Latest reply on Aug 5, 2018 by jbridwell_Dewberry

I have a script that looks at feature class inside a .gdb and prints some simple information about the attributes field. Note- these is actually only one feature class in the .gdb. I want use the `arcpy.Describe` method with fieldInfo. Everytime the script gets to the line `field_info = desc.fieldInfo`, it throws the error `AttributeError: DescribeData: Method fieldInfo does not exist`. My feature class definitely has an attribute table with fields. What is the problem here; why is this error being thrown and how can I fix it? My end goal is to just get a list of the field names in my feature class attributes table:

import arcpy, sys, os

arcpy.env.workspace = r"C:/Workspace/Sandbox/MapChangeProject/data/Alabama.gdb"

 

fcList = arcpy.ListFeatureClasses()
for fc in fcList:

   print("FeatureClass: {}").format(fc)
   desc = arcpy.Describe(fc)

   field_info = desc.fieldInfo
   for index in range(0, field_info.count):
      print("Field Name: {0}".format(field_info.getFieldName(index)))

Outcomes