please sort this out

piyali biswas piyali.de.bis at gmail.com
Wed Apr 18 09:08:27 EDT 2007


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 <piyali.de.bis at gmail.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070418/2aa9c446/attachment.html>


More information about the Python-list mailing list