Hi, I just have a basic question with the arcpy.mp.ArcGISProject() function while trying to follow along a simple tutorial that is a bit old. Here's the relevant code section below
# Import modules
import arcpy
# Create the map document object
aprx = arcpy.mp.ArcGISProject(r"C:\Users\User\Documents\ArcGIS\Projects\MyProject2.aprx")
And this is the OS Error in question:
Traceback (most recent call last):
File "C:\Users\User\Desktop\Exercise ArcGis Python\Ex_Files_ArcGIS_Python_Scripting\Exercise Files\WorkWithListsFinal.py", line 15, in <module>
aprx = arcpy.mp.ArcGISProject(r"C:\Users\User\Documents\ArcGIS\Projects\MyProject2.aprx")
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 344, in __init__
self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True))
OSError: C:\Users\User\Documents\ArcGIS\Projects\MyProject2.aprx
Not really sure what's happening here to not allow me reference the .aprx file which is what I thought the ArcGISProject() command did.