AnsweredAssumed Answered

Arcpy error.

Question asked by BGIS_DT_SP19_EmmaAppel on Apr 21, 2020
Latest reply on Apr 23, 2020 by BGIS_DT_SP19_EmmaAppel

I am currently trying to write a script that iterates through files in a folder to do geoprocessing. However, I am getting held up at the very start of my code with an error I cannot explain or find an answer to. I am basically a novice at Python scripting, however, I have used arcpy and pyscripter successfully throughout my schooling to run moderately complex scripts and have never seen this error before. 


This is the error I am getting:

ERROR: File "c:\program files (x86)\arcgis\desktop10.7\ArcToolbox\Toolboxes\", line 20, in <module>
kmlFile = sys.argv[1] # kml file


<type 'exceptions.IndexError'>: list index out of range


This is my script: 


I should also mention that when I try to set arcpy.env.workspace it seems to be failing after I type in the "arcpy.env." "workspace" does not show up in the autocomplete list so I truly have no idea whats going on.