ERROR

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

Last Published: October 1, 2025

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

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options