I'm trying to use


but a lot of errors are appears. One of them is:

ERROR 000732: Output Location: Dataset results does not exist or is not supported

My code is:

import arcpy

from arcpy import env env.workspace = "C:\Users\user\Documents\ArcGIS\teste"


Should I change something?


1 Answer 1


Your workspace is missing the r before the path or you can replace one backslash \ with two backslashes \\ or you can replace the backslash \ with a forward slash /. You can adjust your code based on the following example:

import arcpy
from arcpy import env

# Set the current workspace
ws = env.workspace = r"F:\Ahmad\Test\DEM"

# Get a list of raster from the workspace
rasterlist = arcpy.ListRasters()

# OR you can pass your target raster data to a list
# rasterlist = [SG-21-Z-D.tif,SG-22-Y-C.tif]

# Execute MosaicToNewRaster_management() tool
mosaic = arcpy.MosaicToNewRaster_management(rasterlist,ws,'MosaicFinal.tif','',pixel_type='16_BIT_SIGNED',number_of_bands=1)

Check the Mosaic To New Raster help for more information.


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.