Skip to content

Commit

Permalink
Fix for GTK errors on headless machines
Browse files Browse the repository at this point in the history
  • Loading branch information
caiusseverus authored Sep 13, 2021
1 parent 1a34ac4 commit de388d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions monthplot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os, io, subprocess
import pandas as pd
import csv, time

if os.environ.get('DISPLAY') is None: # this variable will not be set when X Server is not running
import matplotlib as mplib
# set a different display back-end to squash the error
mplib.use('Agg')

import matplotlib.pyplot as plt
import seaborn as sns

Expand Down

0 comments on commit de388d4

Please sign in to comment.