[Mailman-Developers] Module search path in Python/Mailman

Peter Bengtson peter.bengtson@musikelit.nu
Tue, 02 Apr 2002 11:00:09 +0200


What is the recommended way to extend Python's module search path when
using Mailman? When compiling Mailman (MacOS X), the following warning appears:

> warning: install: modules installed to '/Users/mailman/pythonlib/', 
> which is not in Python's module search path (sys.path) -- you'll have 
> to change the search path yourself

And when Mailman is run, a posting to the moderated "Mailman" list
results in a message which keeps coming back hundreds of times:

> Traceback (most recent call last):
>   File "/Users/mailman/cron/qrunner", line 89, in ?
>     from Mailman.Handlers import HandlerAPI
>   File "../Mailman/Handlers/HandlerAPI.py", line 26, in ?
> ImportError: No module named pythonlib.StringIO

So: should i use $PYTHONPATH dynamically? Or should i set up a symbolic
link in site-packages plus a .pth file? Does this file need to contain
all the subdirectories (email + japanese and further down?) Do I need to
recompile or is this a dynamic process? Should I add the
/Users/mailman/pythonlib directory somewhere in the ./configure
invocation. 

There is absolutely no documentation about this in the 2.1 Mailman beta
distribution. Searching the Python site reveals several strategies, but
it is difficult to know the optimal one to use with Mailman.

Grateful for any help.

	/ Peter Bengtson