Python Forum

Full Version: setting environment in arcpy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In arcpy module, when I set the workspace it seems it doesn't work properly and I get a runtime error as below.

import arcpy
#set the path of the data
arcpy.env.workspace='C:\\test'

#using a buffer function that give me an error
arcpy.Buffer_analysis('chah.shp','C:\\test\\chah_buf1.shp','100 Meters')

Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\analysis.py", line 692, in Buffer raise e ExecuteError: ERROR 000732: Input Features: Dataset chah.shp does not exist or is not supported


#using a buffer function that works fine
arcpy.Buffer_analysis('C:\\test\\chah.shp','C:\\test\\chah_buf1.shp','100 Meters')