I have searched the web for a solution to the following problem and nothing works.
I call matplotlib code from a python script (2.5) running on Apache2.2 and mod_python. When I get to the point where I the code is to save a figure in the website dir I get the following error. File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 324, in _get_configdir raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be a writable dir "%h) RuntimeError: '/root' is not a writable dir; you must set environment variable HOME to be a writable dir The code that creates the fig is a follows: import matplotlib from matplotlib import pylab as plt import numpy as np matplotlib.use('AGG') # use a nongui backend matplotlib.rdParams['MPLCONFIGDIR']='/var/www/modtest/' ... plot code here ... plt.savefig('/var/www/modtest/plot_data/' + plotfile[0]) # use 1st generated random file name First can anyone tell me what "HOME" variable the error message is referring to? I have changed the $HOME env variable under linux Ubuntu Gutsy I have added a $HOME variable to httpd.conf, however I am not an experienced Apache user I can get the code to work from the interactive.py shell rlp -- View this message in context: http://www.nabble.com/Problems-with-saving-figure-from-within-mod_python-script-tp22129192p22129192.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users