Issue with Python for Everyone Tutorial - Step 4

108
3
Jump to solution
a week ago
LCostes
New Contributor

I am taking the Python for Everyone Tutorial and am stuck on Step 4. When I run my SpatialRef script, it generates the following error. 

Traceback (most recent call last):
File "C:/Users/lvc3/Documents/PythonPractice/PythEveryone/HandleErrors/Debugging.py", line 10, in <module>
  arcpy.Buffer_analysis(streams, streams + str(buff), buff)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 1125, in Buffer
  raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 1122, in Buffer
  retval = convertArcObjectToPythonObject(gp.Buffer_analysis(*gp_fixargs((in_features, out_feature_class, buffer_distance_or_field, line_side, line_end_type, dissolve_option, dissolve_field, method), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 511, in <lambda>
  return lambda *args: val(*gp_fixargs(args, True))

arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000725: Output Feature Class: Dataset C:\Users\lvc3\Documents\PythonPractice\PythEveryone\HandleErrors\SanDiego.gdb\SD_Stream100 already exists.
Failed to execute (Buffer).

I haven't touched the ArcPy analysis or _base files but I have edited the Debugging file to change the pathway and fix a couple errors. Thank you for any assistance!!

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Notable Contributor

For those of us not familiar with step 4, could you elaborate and perhaps include the code that would have generated the error?

A quick look, suggests that the file already exists and perhaps the arcpy.env.overwriteOutputs wasn't set in the script.  

Maybe go in and do a manual delete of the SD_Stream100 featureclass before doing any more scripting


... sort of retired...

View solution in original post

3 Replies
DanPatterson
MVP Notable Contributor

For those of us not familiar with step 4, could you elaborate and perhaps include the code that would have generated the error?

A quick look, suggests that the file already exists and perhaps the arcpy.env.overwriteOutputs wasn't set in the script.  

Maybe go in and do a manual delete of the SD_Stream100 featureclass before doing any more scripting


... sort of retired...

View solution in original post

LCostes
New Contributor

Thank you very much, that fixed it!!

0 Kudos
DanPatterson
MVP Notable Contributor

Glad it worked... Enjoy your pythonista journey 😉 


... sort of retired...
0 Kudos