Closed drasmuss closed 7 years ago
I've gotten this error in the past, and the fix was to put this in a if __name__ == '__main__'
block. There was a PR to change this though... I think the exec
is in a try / except
in which the except
has no qualification so the NameError
should be caught by that. I'll try to reproduce.
Does passing the local locals into the constructor fix the problem?
nengo_gui.Viz(__file__, locals=locals(), interactive=False).start()
Weird... it's supposed to be filling in __file__
automatically for exactly this reason:
https://github.com/nengo/nengo_gui/blob/master/nengo_gui/viz.py#L203
Oh, oops, I see... it's not doing that in the netgraph.py
reload case. That same line should be added there.
This has been working for a while (since the server refactoring), so I'm closing this.... :)
When I open
nengo_gui
viait opens up the GUI fine, and the model loads properly. But then if I trigger a reload (e.g. by changing the file), I get this error:
So it seems like the global
__file__
doesn't exist when youexec
the code like that. This is probably something specific to my setup (it seems like it would have been noticed before if it wasn't).Edit: to be clear, line 77 is the
nengo_gui.Viz(__file__).start()
line