I have this script to apply the symbology from one layer to many. But when I try and run it, I get the following error: RuntimeError: Object: Error in executing tool

Here is the rest of my code:

import arcpy  

# Reference current project and mapframe.  
relpath = r'C:\arcGIS_Shared\Python'
p = arcpy.mp.ArcGISProject(relpath + r'\CenterHeatMaps.aprx')
m = p.listMaps('Map')[0]

# Layer file symbology to be imported.  
symbology_layer = (r"C:\arcGIS_Shared\Python\Annual2017_CA_ReferenceLyrx.lyrx")

# Layer to receive imported symbology.  
layers = m.listLayers("CA201*")  
for lyr in layers:   
    #Maintain the symbology ranges
#   arcpy.update_symbology('MAINTAIN')
    #Apply the symbology
    arcpy.ApplySymbologyFromLayer_management(layers, symbology_layer) 

    #print results
    count = arcpy.GetMessageCount()
    print (arcpy.GetMessage(count-1))

What am I missing or doing wrong?

  • Do you get a line number in the error message? Dont combine paths using +, instead use os.path.join. Example: os.path.join(r'C:\arcGIS_Shared\Python', r'CenterHeatMaps.aprx')
    – Bera
    Commented Jan 25, 2018 at 20:07

1 Answer 1


You're passing in a list of layers: layers to the ApplySymbologyFromLayer tool. instead, you need to pass in just the layer: lyr

for lyr in layers: 
    arcpy.ApplySymbologyFromLayer_management(lyr, symbology_layer) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.