No $DISPLAY environment variable with matplotlib on remote server (no sudo) <p>I have been through many post talking about this issue but haven't find anything working on my server. So I am working on a server, on which I don't have a sudo access. I am simply trying to produce plots with matplotlib but I get the infamous </p> <blockquote> <p>TclError: no display name and no $DISPLAY environment variable</p> </blockquote> <p>I tried this ;</p> <pre><code>import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np # fake up some data spread = np.random.rand(50) * 100 center = np.ones(25) * 50 flier_high = np.random.rand(10) * 100 + 100 flier_low = np.random.rand(10) * -100 data = np.concatenate((spread, center, flier_high, flier_low), 0) # basic plot plt.boxplot(data) ##############Crash here plt.savefig( 'output_filename.png' ) </code></pre> <p>But I can't plot at all. Is there anyway to work around that,without involving installing system packages (I can pip install if needed). I am creating a command line tool for some other users so I need something without too much modification. I am using ipython for troubleshooting but get the same error when running with</p> <pre><code>python name_of_script.py </code></pre> <p>Thanks for looking into it.</p>