[Mailman-Users] import email module problem

Mark Sapiro mark at msapiro.net
Tue Apr 1 20:36:26 CEST 2008

prashanth g wrote:
>I am using RHEL and its a 64 bit machine, using mod_python as well. I try to execute the from Mailman import MailList it fails saying:
>Mod_python error: "PythonHandler mod_python.publisher"
>Traceback (most recent call last):
>  File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
>    result = object(req)
>  File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line 213, in handler
>    published = publish_object(req, object)
>  File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py", line 412, in publish_object
>    return publish_object(req,util.apply_fs_data(object, req.form, req=req))
>  File "/usr/lib64/python2.4/site-packages/mod_python/util.py", line 439, in apply_fs_data
>    return object(**args)
>  File "/usr/local/cal/staging/top-deals/alertemail/alertemail.py", line 124, in adduser
>    from Mailman import MailList
>  File "/usr/local/mailman/Mailman/MailList.py", line 40, in ?
>    import email.Iterators
>ImportError: No module named Iterators
>but i could able to import the email.Iterators module from python interpretor any solution?  

How are you setting sys.path so that "from Mailman import MailList"
works at all?

If you are not doing the following, I suggest you do

sys.path.insert(0, '/path/to/mailman/bin')
import paths

This will insure that everything is set up for Mailman to get what it
needs from subsequent imports.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list