Python Forum
setting environment in arcpy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setting environment in arcpy
#1
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')
Reply
#2
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')
Error:
Traceback (most recent call last): File "C:/test/t.py", line 7, in <module> arcpy.Buffer_analysis('chah.shp','C:\\test\\chah_buf1.shp','100 Meters') File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\analysis.py", line 692, in Buffer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset chah.shp does not exist or is not supported Failed to execute (Buffer).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Iterating an attribute table using Arcpy teflon 6 3,983 Oct-28-2019, 09:15 PM
Last Post: teflon
  Advice on Setting Up the Python Environment punksnotdead 1 2,340 May-15-2019, 04:29 PM
Last Post: snippsat
  ARCPY enter excel table into coded domain Just_another_lost_man 6 3,661 Feb-23-2019, 09:23 PM
Last Post: buran
  setting pythonpath variable in environment variables saisankalpj 3 3,426 Dec-05-2018, 10:33 PM
Last Post: Gribouillis
  ARCPY using the arcpy.da.UpdateCursor CornJulio 2 4,745 Oct-12-2016, 03:49 AM
Last Post: CornJulio

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020