Long story short, I'm following your excellent Youtube series on reversing wannacry, and due to headaches with the ooanalyzer plugin, moved from Windows to Linux, and transferred the project from one to the other in order to preserve my work so far.
However, the following line in yara.py:
currentProgram.getDomainFile().getMetadata()["Executable Location"]
Returns the old location on my C: drive, rather than its current location in my Linux machine. I can workaround this by manually specifying the executable location.
This may be a bug with Ghidra rather than your script.