Select to view content in your preferred language

Why does arcpy.mp.ArcGISProject() give an OSError?

10872
11
Jump to solution
06-01-2017 08:07 PM
MatthewCallahan1
Occasional Contributor

I read the "Guidelines for arcpy.mp" doc, but when I call the sample code myself in the ArcGIS Pro Python window or from a Python script, I get this error:

import arcpy
aprx = arcpy.mp.ArcGISProject(r'C:\Path\To\Project\test_project.tbx')

Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 283, in __init__
    self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True))
OSError: C:\Path\To\Project\test_project.tbx

Is this normal expected behavior?  The example code shows setting the project variable with an explicit .aprx file path, and I'm wondering why I'm unable to do the same on my machine.  The .aprx file is present/there are no misspellings in the file path in my code.  For reference, I'm running a fresh Windows 7 64-bit install with a fresh ArcGIS Desktop install as well (Pro v 1.4.1).

11 Replies
AllenDailey1
Frequent Contributor

You're welcome @Sean-Sweeney !  Thanks so much for your comment; I'm so glad to know that my comment was useful for someone!

0 Kudos
StefanUseldinger
Frequent Contributor

The OSError also appears when calling .save() while the project is still open on a different machine.

0 Kudos