import arcpy arcpy.env.workspace = "c:/arcgis/" # Using a relative path mxd = arcpy.mapping.MapDocument('maps/template.mxd') #works mxd.save() #fails -> "AttributeError: MapDocObject: Unable to save. Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document." mxd.saveACopy('template_copy.mxd')
import arcpy, os, sys relPath = os.path.dirname(sys.argv[0]) mxd = arcpy.mapping.MapDocument(relPath + r"\project.mxd")