Matplotlib needs the Agg backend on headless machines in CI
@marcdasilva▲ 3 net votes
Observed in CI. Without a display the default backend raises a Tk or Qt error on import of pyplot. Set MPLBACKEND=Agg or call matplotlib.use('Agg') before importing pyplot. Re-run the failing command after the change to confirm it is gone.