hi all, I solved the problem with the help of python cookbook+matplotlib I was getting the main error as * raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Matplotlib needs the environment variable HOME to point to a writable directory.Thats why i did os.environ[ 'HOME' ] = 'C:/temp' and the cgi-script worked. For further questions about cgi+matplotlib/networkx please see http://www.scipy.org/Cookbook. Its very useful
Thanks, Piyali Biswas On 4/16/07, piyali biswas <[EMAIL PROTECTED]> wrote:
Hi, I am using networkx and pylab for creating a graph using a python script abc.py. I have saved the networkx folder in "C:/Python24/Lib/site-packages". When I run the script from command prompt, it creates the graph and saves it to the place I want to but when I write a python-cgi script and run it as os.system('python abc.py') it doesn't gives me any result. I have included the path of my system using os.environ['PATH'] = ".........". I also appended the path of networkx directory using sys.path.append('C:/Python24/Lib/site-packages') as it seems to me that it is a path related problem and the cgi result page shows error (1) networkx *undefined* (2)* *drawing undefined (3) nx_pylab *undefined* (4) matplotlib *undefined* *(5) raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be * * a writable dir "%h)* Can you please tell me how to enable cgi to run this program on runtime. I have kept both the cgi script as well as python script in Apache/cgi-bin folder. Thanks, Piyali
-- http://mail.python.org/mailman/listinfo/python-list