[mod_python] Error

Jim Gallacher jpg at jgassociates.ca
Wed May 23 14:56:57 EDT 2007


Idoia Villacián Zárate wrote:
> I install apache, then python and later mod_phython and all intalls correctly, I 
> read mod_python’s tutorial and there I have the lines I have to write in 
> apache’s configuration file. After doing this when I restart apache everything 
> goes ok. Untill here everything goes fine
> 
> I continue reading the tutorial and there is an example of what I have to do to 
> get Hello World !. I copy it exactly as is written in the phyton program:
> 
> from mod_python import apache
> 
>  
> 
> def handler(req):
> 
>         req.content_type = 'text/plain'
> 
>         req.write("Hello World!")
> 
>         return apache.OK
> 
>  
> 
>  
> 
> So now, when I compile this program is when I get the error:
> 
> Traceback (most recent call last):
> 
>   File "C:\Archivos de programa\Apache Software 
> Foundation\Apache2.2\htdocs\mptest.py", line 1, in ?
> 
>     from mod_python import apache
> 
>   File "C:\Python24\Lib\site-packages\mod_python\apache.py", line 30, in ?
> 
>     import _apache
> 
> ImportError: No module named _apache
> 
> 
> Do you know what can be the problem?

As Graham suggested previously you are not giving us enough information. 
How are you compiling the program? Generally you don't want to compile 
it yourself. Just access the appropriate URL and let mod_python do the 
compiling for you - at least until you've got everything working and 
have a better understanding of how mod_python works.

Jim



More information about the Mod_python mailing list