Error: Python script execution fails with "IndexError: list index out of range"
Running a standalone geoprocessing script from a Python IDE returns the error "IndexError: list index out of range". An example of the message in the Interactive Window can be seen in the screenshot below.
The script may contain arguments that must be passed into the script by the user at runtime.
Solution or Workaround
Depending on the structure of the script, pass in the appropriate arguments. These can be identified by reviewing the code prior to executing the script.
- In the initial execution dialog, type the strings into the Arguments text box.
- Click OK to run the script with the arguments now being passed in. In the following screenshot, the successful geoprocessing results are returned in the Interactive Window.