diff --git a/src/scrublet/helper_functions.py b/src/scrublet/helper_functions.py
index 816526d..e04abab 100644
--- a/src/scrublet/helper_functions.py
+++ b/src/scrublet/helper_functions.py
@@ -4,6 +4,8 @@ import scipy.stats
 import scipy.sparse 
 from sklearn.decomposition import PCA,TruncatedSVD
 from sklearn.neighbors import NearestNeighbors
+import matplotlib
+matplotlib.use('Agg')
 import time
 
 ########## PREPROCESSING PIPELINE
diff --git a/src/scrublet/scrublet.py b/src/scrublet/scrublet.py
index 4b5fbd5..e37e42c 100644
--- a/src/scrublet/scrublet.py
+++ b/src/scrublet/scrublet.py
@@ -1,5 +1,7 @@
 from .helper_functions import *
 from sklearn.decomposition import PCA, TruncatedSVD
+import matplotlib
+matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 
 class Scrublet():
