I'm not sure why I'm running into this problem. I thought it might have something to do with the merged file being locked or open, but I don't see a "LOCK" file being created in Windows Explorer.

I'm simply trying to Merge a bunch of files and then Dissolve the merged file. Here's my script:

workspaces = arcpy.ListWorkspaces("*", "Folder")
for workspace in workspaces:

    arcpy.env.workspace = workspace
    shps = arcpy.ListFeatureClasses("*", "ALL")

    ## Process: Merge Layers
    descWorkspace = arcpy.Describe(workspace)
    workspaceName = descWorkspace.baseName

    mergeOutput = workspaceName+"_merge"
    arcpy.Merge_management(shps, mergeOutput)

    ## Process: Dissolving Features              <--HERE IS WHERE I'M HAVING PROBLEMS
    disInput = mergeOutput
    disOutput = mergeOutput+"_dis"
    arcpy.Dissolve_management(disInput, disOutput)

This is the error that I'm getting after the merge runs successfully: ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset Bus04_merge does not exist or is not supported

I'm obviously missing a step here... (or using incorrect parameters, but I can't figure out in what way)

  • 1
    What happens when you print shps? Is the list of shapefiles in "workspace" displayed? – Aaron Jan 5 '13 at 19:24

Try changing the following line in your code:

mergeOutput = workspaceName+"_merge"


mergeOutput = workspaceName+"_merge.shp"



  • I ended up rewriting much of the code, so I can't try that out exactly, BUT, I think ultimately I did realize that changing that to .shp DID help, so great suggestion. Thank you!! – Kristen G. Jan 5 '13 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.