I'm new to GIS programming, and am going through the Esri "Getting Started with arcpy.mp" tutorial.
When I try the following:
lyrFile = arcpy.mp.LayerFile(r"path to a layer file")
I get the following error:
File "", line 1, in File "c:\users\ME\appdata\local\programs\arcgis\pro\Resources\arcpy\arcpy_mp.py", line 773, in init self._arc_object = arcgisscripting._mapping.LayerFile(*gp_fixargs((layer_file_path,), True)) OSError: C:\Users\ME\Documents\ArcGIS\myLayer.lyrx
Typical google search doesn't really bring up much except for Adding feature class to Map in CURRENT project using ArcPy in ArcGIS Pro?
I've tried the alternate methods of adding a Layer file as suggested in the question thread, but get the same OS error.
What is causing this error, so I can figure out how to resolve it?