<div>hi all,</div>
<div>I solved the problem with the help of python cookbook+matplotlib</div>
<div>I was getting the main error as <em><font size="2"><font color="#3333ff"><font face="Courier New">raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be</font></font>
<font color="#909090"> </font></font></em></div>
<div><font face="Courier New" color="#3333ff" size="2"><em> a writable dir "%h)</em></font></div>
<div>Matplotlib needs the environment variable HOME to point to a writable directory.Thats why i did</div>
<div><span class="ID">os</span><span class="Operator">.</span><span class="ID">environ</span><span class="Operator">[</span> <span class="String">'HOME'</span> <span class="Operator">]</span> <span class="Operator">
=</span> <span class="String">'C:/temp'</span></div>
<div><span class="String">and the cgi-script worked.</span></div>
<div><span class="String">For further questions about cgi+matplotlib/networkx please see</span></div>
<div><span class="String"></span><a href="http://www.scipy.org/Cookbook">http://www.scipy.org/Cookbook</a>. Its very useful</div>
<div> </div>
<div>Thanks,</div>
<div>Piyali Biswas<br> </div>
<div><span class="gmail_quote">On 4/16/07, <b class="gmail_sendername">piyali biswas</b> <<a href="mailto:piyali.de.bis@gmail.com">piyali.de.bis@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div>Hi,</div>
<div>I am using networkx and pylab for creating a graph using a python script abc.py.</div>
<div>I have saved the networkx folder in "C:/Python24/Lib/site-packages".</div>
<div>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 </div>
<div><font color="#ff0000">os.system('python abc.py')</font></div>
<div>it doesn't gives me any result.</div>
<div> </div>
<div>I have included the path of my system using </div>
<div><font color="#ff0000">os.environ['PATH'] = ".........".</font></div>
<div><font color="#ff0000"></font> </div>
<div><font color="#000000">I also appended the path of networkx directory using </font></div>
<div><font color="#ff0000">sys.path.append('C:/Python24/Lib/site-packages')</font><font color="#000000"> as it seems to me that it is a path related problem and the cgi result page shows error </font></div>
<div><font color="#000000">(1) </font><font color="#3333ff"><font size="2">networkx <em>undefined</em></font></font></div>
<div><font color="#3333ff" size="2"><font color="#000000">(2)</font><em> </em><font color="#3333ff" size="2">drawing undefined</font></font></div>
<div><font size="2"><font color="#909090"><font color="#000000">(3) </font></font><font color="#3333ff">nx_pylab <em>undefined</em></font></font></div>
<div><font size="2"><font color="#909090"><font color="#000000">(4) </font></font><font color="#3333ff">matplotlib <em>undefined</em></font></font></div>
<div><em><font color="#909090" size="2"><font color="#000000">(5) </font><font face="Courier New" color="#3333ff">raise RuntimeError("'%s' is not a writable dir; you must set environment variable HOME to be</font>
 </font></em></div>
<div><em><font size="2"><font face="Courier New" color="#3333ff"> a writable dir "%h)</font></font></em></div>
<div><font face="times new roman,serif" color="#000000" size="2">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. 
<span></span></font></div>
<div> </div>
<div><font face="Times New Roman" size="2">Thanks,</font></div><span>
<div><font face="Times New Roman" size="2">Piyali</font></div></span></div></blockquote></div><br>