From 485ba419b3db38effc9e7d8d984d180dc4414732 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Fri, 1 May 2015 10:04:02 +0100 Subject: [PATCH] energy_model: set matplotlib backent to AGG Matplotlib defautls to the GTK backend. This can cause problems when running in a headless session (e.g. over SSH). Since energy_model istrument generates PNG plots, rather than rendering directly to UI, it doesn't actually need GTK; set backend to AGG so that energy_model works in headless environments. --- wlauto/instrumentation/energy_model/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wlauto/instrumentation/energy_model/__init__.py b/wlauto/instrumentation/energy_model/__init__.py index 43b5b8b8..6ce94740 100644 --- a/wlauto/instrumentation/energy_model/__init__.py +++ b/wlauto/instrumentation/energy_model/__init__.py @@ -11,6 +11,8 @@ from collections import Counter, namedtuple try: import jinja2 import pandas as pd + import matplotlib + matplotlib.use('AGG') import matplotlib.pyplot as plt import numpy as np import_error = None