[mod_python] Re: mod_python on Windows

Peter Brown peter at outputdsj.com.au
Mon Jun 23 21:06:05 EST 2003


// Okay, it loads with 2.2.3, but I'm getting the ImportError: No module
// named _apache
// from my cgi-bin (when run from within Apache, *NOT* from the the command
//l ine.
// Any idea what PYTHONPATH, PATH, etc. might help it find _apache? (which
// I assume should be loaded from the c:\Program Files\Apache
// Group\Apache2\modules dir,
// with the LoadModule python-module modules/mod_python.so  directive, but
// doesn't
// seem to be).

With 2.2.3 now I can get Apache to load mod_python.so successfully, and even
got the ole fave "Hello World" to work a few times.

Now when I run it mod_python loads OK but I get the following error: I guess
some changes I made to the Apache config file caused the problem. Buggered
if I know what. So if anyone has any ideas I will be more than welcome to
hear them.

Anyhow here's the error:

Mod_python error: "PythonHandler test"

Traceback (most recent call last):

  File "C:\Python22\Lib\site-packages\mod_python\apache.py", line 320, in
HandlerDispatch
    module = import_module(module_name, config)

  File "C:\Python22\Lib\site-packages\mod_python\apache.py", line 499, in
import_module
    module = imp.load_module(mname, f, p, d)

  File "C:/Program Files/Apache Group/Apache2/htdocs/music/\test.py", line 2

    def handler(req):

    ^

SyntaxError: invalid syntax





More information about the Mod_python mailing list