ERROR

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

Last Published: April 25, 2020

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]

Article ID: 000011161

Software:
  • ArcMap

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options