04-04-2021 03:17 AM
New Contributor

I am trying to run the Laharz_py program and keep on receiving this error message when trying to run the models. I know next to nothing about python scripting. Would anyone please be able to explain, (preferably in layman's terms, I really am clueless,) what this means and how I might fix it.

Traceback (most recent call last):
File "E:\Xally\8°\ERIA\Procesos\ArcGis\laharz\laharz_py_example\laharz_py\", line 1621, in <module>
File "E:\Xally\8°\ERIA\Procesos\ArcGis\laharz\laharz_py_example\laharz_py\", line 974, in main
UnboundLocalError: local variable 'PrefixName' referenced before assignment

Failed to execute (

0 Kudos
3 Replies
MVP Esteemed Contributor

The error message means that something that was expected (in your case a variable called PrefixName) doesn't have a value, or a value it can use.

... sort of retired...
0 Kudos
by Anonymous User
Not applicable

Your script is trying to use the variable named 'PrefixName' before it is being created, hence, the last line in the Error: local variable 'PrefixName' referenced before assignment'. Make sure that it is created before you try to use it.

New Contributor

Hi Xally, wondered if either of these solutions worked for you, as I am having the same issue but changing the prefix has made no impact in the drop down menu. I would appreciate knowing how you resolved this!

0 Kudos