ERROR 000732: Input Data Element: Dataset temp does not exist or is not supported
Failed to execute (Delete).
ESRI helped me get around this by deleting the variable at the end. It's been running a lot longer than I've been able to get it to run. So I think it's working. This is what I did:
graphExport = "tempGraphDelete"
arcpy.MakeGraph_management(graphCopy, "SERIES=line:vertical DATA={0} X=Distance Y=Invert SORT=ASC;SERIES=line:vertical DATA={0} X=Distance Y=Crown \
SORT=ASC;SERIES=line:vertical DATA={0} X=Distance Y=GrElev SORT=ASC;GRAPH=general TITLE={1} SUBTITLE={2}: ;LEGEND=general;AXIS=left \
TITLE=Elevation in Feet;AXIS=right TITLE=Invert;AXIS=bottom TITLE=Distance in Feet;AXIS=top".format(ClosedConduitsVertexPoints, titleVariable, subtitleVariable), graphExport)
del graphExport
Came across this post and I'm having the same issue as Richard Watson. I have a Python Toolbox that can create a graph fine on the first try, but subsequent runs of the tool results in an error. Closing ArcMap deletes the temporary graph & the tool will run correctly once, but I'm unable to delete the temporary graph using Arcpy. Has anyone found a solution? I've tried several approaches to delete the temp graph file with no luck.
def execute(self, parameters, messages):
# Attempt to setup Current Workspace
folder = parameters[0].valueAsText
arcpy.env.workspace = folder
referenceFiles = os.path.join(os.path.dirname(__file__), "Reference Files - Please don't alter\This Tool"
graph_Template = os.path.join(referenceFiles, "ownership.grf")
(1st approach)
if arcpy.Exists("temp_graph"):
arcpy.Delete_management("temp_graph")
arcpy.MakeGraph_management(graph_Template, [...], "temp_graph")
arcpy.SaveGraph_management("temp_graph", [...]
else:
arcpy.MakeGraph_management(graph_Template, [...], "temp_graph")
arcpy.SaveGraph_management("temp_graph", [...])
(2nd approach)
arcpy.MakeGraph_management(graph_Template, [...], "temp_graph")
arcpy.SaveGraph_management("temp_graph", [...])
arcpy.Delete_management("in_memory")
Here's my question posted on stack exchange: