[mod_python] Problem to run .py scripts thru apache

Joost Yervante Damad joost.damad at siemens.atea.be
Thu Feb 22 11:55:49 EST 2001

'Ralf Fortnagel' wrote about '[mod_python] Problem to run .py scripts thru apache' - Thu, Feb 22, 2001 at 11:41:01AM CET
> Hi Folks!
> I use Apache/1.3.14 (Win32) mod_python/2.7.1 Python/2.0 on a Win/NT4.0
> machine
> If i try to start any .py file thru apache, i get following error:
> Mod_python error: "PythonHandler test"
> Traceback (most recent call last):
>   File "c:\programme\python20\lib\mod_python\apache.py", line 180, in
> Dispatch
>     object = resolve_object(self.req, module, object_str, silent)
>   File "c:\programme\python20\lib\mod_python\apache.py", line 396, in
> resolve_object
>     raise AttributeError, s
> AttributeError: module 'c:\programme\python20\lib\test\__init__.py' contains
> no 'handler'
> please help me, i don't know what's wrong... :(
> --
> Ralf Fortnagel                21TORR AGENCY gmbh
> r.fortnagel at 21torr.com        Engineering
> tel: +49-7121-348-221         Heinestrasse 72
> fax: +49-7121-348-259         D-72762 Reutlignen
> 21TORR - die neue medien leidenschaft
> www.21torr.com

I asume you have in your apache config file:

PythonHandler test

This means that mod_python needs to look for a pythonscript called 'test'.

But :) In your Pythonpath you also have the dir c:\programme\python20\lib\
and the directory c:\programme\python20\lib\test\ matches your handler.

Python then looks for an __init__.py to 'execute' the directory as a
pythonscript, and this is obviously not what you want.


Joost Damad - Siemens IC D NC A - +3214252297
Five is a sufficiently close approximation to infinity.
       -- Robert Firth
"One, two, five."
       -- Monty Python and the Holy Grail

More information about the Mod_python mailing list