matplotlib and zope problem

Hello All,

   I'am sorry, for resenting this email, but I had some problems with my
e-mail client, and (probably) lost the response (if there was any)
before I could read it. The archive of matplotlib-users list are messed
up, because the last post there is from 2006-10-02, and it prevent's me
from check if there was any answer to my post.
Please resent to me the answer (if any was given). The original message
is given below, and the traceback from zope below the mail. Thanks in
advance.

Greetings,
Marek Szczypinski

···

-------- Original Message --------
Subject: matplotlib and zope problem
Date: Sun, 12 Nov 2006 08:20:45 +0100
From: Marek Szczypiński <markacy@...1347...>
To: matplotlib-users@lists.sourceforge.net

Hello All,

  I've been using matplotlib for some time now, and I want to connect it
with zope. I'am using the example code from page:
http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope ,
but whenever I try to import matplotlib, and/or pylab packages i get
this error from zope:

Error Type: RuntimeError
Error Value: '/' is not a writable dir; you must set environment
variable HOME to be a writable dir

Have You got any ideas, on what might go wrong? I'am using matplotlib
0.87.4, and zope 2.9.5 with python 2.4.3 on gentoo linux box.

Thanks in advance for any help.

Marek Szczypinski

Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.ExternalMethod.ExternalMethod, line 59, in manage_addExternalMethod
  Module Products.ExternalMethod.ExternalMethod, line 111, in __init__
  Module Products.ExternalMethod.ExternalMethod, line 134, in manage_edit
  Module Products.ExternalMethod.ExternalMethod, line 141, in getFunction
  Module App.Extensions, line 148, in getObject
   - __traceback_info__: ('/var/lib/zope/zope-markacy/Extensions/mpl.py', 'mpl')
  Module /var/lib/zope/zope-markacy/Extensions/mpl.py, line 1, in ?
  Module None, line 1011, in ?
  Module None, line 968, in rc_params
  Module None, line 914, in matplotlib_fname
  Module None, line 273, in wrapper
  Module None, line 324, in _get_configdir
RuntimeError: '/' is not a writable dir; you must set environment variable HOME to be a writable dir

Just before you import matplotlib or pylab, try this:

import os
os.environ['HOME'] = '/tmp/'

Does that help?

Also, BTW, the user running Zope should have a home directory that he can write to. Fix that in /etc/passwd and you should be okay (and not need the above hack).

-- Asheesh.

···

On Thu, 16 Nov 2006, Marek Szczypi�~Dski wrote:

Error Type: RuntimeError
Error Value: '/' is not a writable dir; you must set environment
variable HOME to be a writable dir

--
QOTD:
   "I thought I saw a unicorn on the way over, but it was just a
   horse with one of the horns broken off."