Error Code Portal
PythonPythonError code

UnboundLocalError

UnboundLocalError

Code UnboundLocalError · An issue reported by Python.

Raised when a reference is made to a local variable in a function or method, but no value has been bound to that variable. This is a subclass of NameError.

Troubleshooting and diagnostic links

First check that the document's product, version, and environment match your situation.