English

Error: Python script execution fails with "IndexError: list index out of range"

Error Message

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.
[O-Image]

Cause

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.

  1. In the initial execution dialog, type the strings into the Arguments text box.
    [O-Image]
  2. 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.
    [O-Image]

Related Information