needed to move the use('Agg') before importing other things