Closed fakufaku closed 5 years ago
In https://github.com/ipython/ipython/pull/10974 is a PR to fix that and a workaround to hide this bug.
@boeddeker Thanks for the pointer! I guess implementing the workaround would take the same effort as moving the imports into the dedicated functions...
You are right. I only wanted to give a pointer to those that also hit this bug. Your solution to move the plotting stuff imports in dedicated functions sounds good.
It is good to know that it is a known issue of ipython. I spent quite some frustrating time trying to debug that... Now I just need to sit down and do this ;)
I also invested some time to figure out where the cause of the bug is. Only ipython has this bug (Python works fine with matplotlib and Qt backend).
In my case, I use ipyparallel for parallel simulations and this was particularly frustrating to debug... :-/
Addressed by PR #55
When matplotlib is loaded on a system without a display (i.e. servers or computing nodes), calling matplotlib with a different backen than 'Agg' will cause a crash.
The solution is to limit matplotlib imports to calls that actually plot something.