AnsweredAssumed Answered

ExecuteError: Failed to execute. Parameters are not valid error when SelectLayerByAttribute run in Python 2.7

Question asked by jbridwell_Dewberry on Oct 24, 2018
Latest reply on Oct 24, 2018 by bixb0012

I am running a line of code in a Python 2.7 environment using arcpy.SelectLayerByAttribute_management:

fl_haz_selects = arcpy.SelectLayerByAttribute_management(S_Fld_Haz_Ar, "NEW_SELECTION", "\"DFIRM_ID\" = '{}'".format(fipC))

It runs perfectly fine in Python 3.6. Now I am getting the following errors. What am I doing incorrectly here? Note: S_FLD_Haz_Ar is a shapefile. Do I just need to make it into a layer? I am trying to avoid making a physical layer.

Traceback (most recent call last): File "", line 3, in File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 7713, in SelectLayerByAttribute raise e ExecuteError: Failed to execute. Parameters are not valid. The value cannot be a feature class ERROR 000840: The value is not a Raster Layer. ERROR 000840: The value is not a Mosaic Layer. Failed to execute (SelectLayerByAttribute).

Outcomes