try: # Standardize backend due to random inconsistencies from matplotlib import pyplot pyplot.switch_backend('agg') except: pass