I'm using matplotlib in a Django app served through apache on Mac OS X 10.7.5 but I can't get it to plot a figure for me. I've imported import matplotlib.pyplot as plt
, and the line in my view,
plt.plot(x, y)
(x
and y
are numpy arrays) is causing the error
2013-01-23 16:39:16.731 httpd[381:203] The application with bundle ID (null) is running setugid(), which is not allowed.
in my apache error_log. I'm afraid I don't know what setugid()
is, or how to make running it allowed for my app.
My $MPLCONFIGDIR
is set to /tmp/.mplconfig
and apache as user _www has written a couple of empty directories to it, so that seems to be working OK.
Can anyone give me a clue?
Update: if I
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
and set up a figure, subplot and axes (the whole caboodle), I can savefig() without an error... what extra permissions does pyplot need?
Using the agg backend after importing matplotlib
got rid of the setugid()
error in a Flask app
running under OS X Server
in Sierra
import matplotlib as mpl
mpl.use('agg')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With