I have a CSV list containing paths to 800 TIFF files that I want to add to a mosaic dataset.

So using the Add Rasters to Mosaic Dataset tool, I need to create a loop which changes the input_path variable based on a list derived from the CSV. The CSV paths are formatted as follows -


Looking at the documentation (https://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-rasters-to-mosaic-dataset.htm), I've copied the stand alone script and converted the CSV to a Python list but am lost how to actually link the two together.

import arcpy,os,csv

arcpy.env.workspace = 'D:\'
md = 'D:\Map.gdb\Mosaic'

with open('D:\Mosaic_list.csv') as mosaic_csv:
        reader = csv.reader(mosaic_csv, delimiter=' ', quotechar='|')
        mosaic_list = list(reader)

for row in mosaic_list:
    arcpy.AddRastersToMosaicDataset_management(in_mosaic_dataset = md, raster_type = 'Raster Dataset',  input_path = row)

The above code results in - ERROR 000732: Input Data: Dataset Path does not exist or is not supported.

Is my approach correct or am I looking at this the wrong way?

  • 4
    How the paths are organized inside the CSV file? It is better to add a sample of the CSV file into your question.
    – ahmadhanb
    Sep 18, 2019 at 6:53
  • 2
    Have you tried testing on arcpy.Exists() during list assembly?
    – Vince
    Sep 18, 2019 at 10:35

1 Answer 1


Ok, thanks to Vince and ahmadhanb for the guidance. I was convinced the issue was with my lack of my python skills but I went back to square one and looked at my data after and found the first row of my CSV was 'pathname' and was the cause of the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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