[mod_python] Troubles with including local modules

Pavel Roitberg pavel at madman2k.net
Mon May 29 16:51:50 EDT 2006


I'm trying to dig into python using mod_python, but I already fail with
this easy thing.
I can include modules located in /usr/lib without problems, but when I
try to include a local module I'm getting the following error:

Mod_python error: "PythonHandler index"

Traceback (most recent call last):

   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch

   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
457, in import_module
     module = imp.load_module(mname, f, p, d)

   File "/home/pavel/data/webwork/python/index.py", line 3, in ?
     from module import article

ImportError: cannot import name article

It only works after python generates the according pyc files. (when I
import them manually using the interpreter)

Apache.import_module() does not work at all; neither error, nor module
in local namespace.

The environment is:
mod_python 3.1.4
apache 2.0.55-4ubuntu2
python 2.4.2-0ubuntu3
Ubuntu 6.06


More information about the Mod_python mailing list