Plotting-related failures on Windows
Since the beginning, I've had to work around some plotting-related issues to get BETSE to run in Windows. I've now confirmed it on a second machine with a clean installation, so I figured I should share the patches (though, you may have better solutions for the same issues).
FWIW, I've never been able to get "setup.py install" to run correctly anywhere, not Linux, not Windows, so I've been running BETSE in-place ("setup.py test" or "python -m betse.cli") in a prepopulated distribution -- Anaconda on Windows or a venv where I have pip'ed all the required dependencies on Linux. I don't entirely understand what setup.py install is complaining about, but a transcript from Windows 10 is attached. The problem may be related. setup.py_install_transcript_Win10_Anaconda3-4.2.0_venv.txt
Anyway, what I found is that Windows 10 plus an fresh install of Anaconda (both 32-bit and 64-bit) leads to an error deep in matplotlib because it cannot find the Qt4Agg aggregator -- and I can't seem to find any package that will provide it on Python 3.5 (what Anaconda is bundling right now). If I change the aggregator to TkAgg (which is apparently bundled with Anaconda), then it runs fine. I can also manually install PyQt5 and set Qt5Agg as the aggregator, but that seems to offer no advantages over TkAgg. I'm not seeing a configuration option to override the default aggregator, so I had to patch the code:
/betse/lib/matplotlib/matplotlibs.py elif oses.is_windows(): - self.backend_name = "Qt4Agg" + self.backend_name = "TkAgg" ######### "Qt4Agg" + # Else, the current platform is Linux. In this case, default to the
Also, regardless of whether the backend is TkAgg or Qt5Agg, Windows has a tendency to complain that the plot window is not responding and grey it out, completely breaking animation, because BETSE is not bothering to process UI messages. I made the following tweak to fix this:
/betse/science/visual/anim/animabc.py # superclass-specific plotting. self._plot_frame_figure() + pyplot.pause(0.001) ### fixes not-responding (ghosting) issue + # If saving this animation, save this frame.
(There may be a more sensible solution, but the root problem, that BETSE's main thread is continuing to compute rather than handle the UI, seems to be a fundamental hurdle in using matplotlib.)
(System info: betse_info_Win10_Anaconda3-4.2.0_no-venv.txt)