Error Reporting
Learn about common error messages to debug your Python scripts. Exceptions which happen in Python code and are not caught in Python code (e.g. when you try to open a file that does not exist) trigger an error dialog box in GeoDict and terminate the execution of the macro.
In the following find error messages and their explanations for common errors.
Variables Dictionary

|
Note! Since GeoDict 2025 the variables section does not need to be a dictionary anymore, but instead can be a list of dictionaries. Thus, the errors regarding variable numbering also can be easily solved by changing the section to the new syntax. The old syntax, however, is still supported.
|
KeyError: 'Variable#'
|
There are not as many variables given in the dictionary as given by the NumberOfVariables entry in the Variables dictionary.
A common error leading to this message can also be, that the third variable was not named Variable3 after copying and pasting Variable1 for example.
|
AssertionError: NumberOfVariables does not match the number of entries in the Variables Dictionary
|
This error happens, if there are more variable entries, than the NumberOfVariables parameter determines.
|
GeoDict Commands
Command Queue: pre-checking of command no # … failed: Error while reading settings and materials for …
|
This error message means that needed keys in the corresponding GeoDict command dictionary are missing. This can happen if commands from a macro recorded with an earlier GeoDict release are copied into a newer macro, because the command parameters may have changed. This issue can easily be resolved by explicitly giving the right release year as input argument for the gd.runCmd function, as by default the release is taken from the macro file header.
|
A command with the name X:Y is not valid.
|
If the given command name does not exist, for example when typing it manually or changing it after recording, this message appears. The command in this example FiberDict:Create should be FiberGeo:Create.
|
Invalid Syntax
There are many possibilities to obtain a syntax error. Some of the most common syntax errors are:
SyntaxError: invalid syntax. Perhaps you forgot a comma? (macrofilepath, line)
|
This means, a comma in the end of a line in a Python dictionary is missing.
|
SyntaxError: invalid syntax. '{' was never closed (macrofilepath, line)
|
This, means, a closing bracket is missing somewhere.
|
SyntaxError: invalid syntax. unterminated string literal (macrofilepath, line)

This means, a quotation ending is missing somewhere.
|
SyntaxError: invalid syntax. expected ':' (macrofilepath, line)
|
This means there is a colon missing (e.g. in definitions or in the line defining a loop.
|
IndentationError: expected an indented block (macrofilepath, line)
|
This error message appears, if no indented block is found, where it is expected, e.g. in a loop ('for' statement).
|