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
  Need help setting up trusted root ca in virtual environment dstempfley 0 117 May-31-2024, 03:14 PM
Last Post: dstempfley
  Iterating an attribute table using Arcpy teflon 6 4,169 Oct-28-2019, 09:15 PM
Last Post: teflon
  Advice on Setting Up the Python Environment punksnotdead 1 2,440 May-15-2019, 04:29 PM
Last Post: snippsat
  ARCPY enter excel table into coded domain Just_another_lost_man 6 3,862 Feb-23-2019, 09:23 PM
Last Post: buran
  setting pythonpath variable in environment variables saisankalpj 3 3,566 Dec-05-2018, 10:33 PM
Last Post: Gribouillis
  ARCPY using the arcpy.da.UpdateCursor CornJulio 2 4,901 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