Help with mod_python

Bengt Richter bokr at oz.net
Mon Sep 2 15:07:07 EDT 2002


On Sat, 31 Aug 2002 12:54:09 -0400, "Joseph Youssef" <leader730 at hotmail.com> wrote:

>Hello, I've been trying to get python to work on apache, so I downloaded
>mod_python, after I finished the setup process, I tried to test it just like
>they indicated with the same code they showed but everytime I to run any
>python file on the server, it always gives me this error:
>
>the file I ran here was called mptest.py
>
>-----------------------------------------------
>Mod_python error: "PythonHandler mptest"
>
>Traceback (most recent call last):
>
>  File "C:\PROGRAM FILES\PYTHON\lib\mod_python\apache.py", line 181, in
>Dispatch
>    module = import_module(module_name, _req)
>
>  File "C:\PROGRAM FILES\PYTHON\lib\mod_python\apache.py", line 332, in
>import_module
>    f, p, d = imp.find_module(parts[i], path)
>
>ImportError: No module named mptest
>----------------------------------------------
>I don't know how to fix it so if you know how then please help
>
Apache is probably running as a different user than you (e.g., maybe IUSR_XXX, where XXX is your
computer name), so probably you have to move mptest.py to some directory (you may want to create
one in the tree it already knows about for web stuff) where apache can find it, or tell it where
to find stuff in your personal part of the disk (the latter is not a good idea security-wise).

There could be other problems, but that would be my first guess.

Regards,
Bengt Richter



More information about the Python-list mailing list