[mod_python] ImportError: Cannot find _apache

Graeme Matthew graeme_matthew at hotmail.com
Thu May 29 21:37:35 EST 2003

Hi all me again ....

Im almost there ...

I keep on getting the following error in my cgi-script, on the command line, 
I have included my httpd.conf directives and some additional information...

Any help would be much appreciated ...



[root at amazulu cgi-bin]# /usr/local/bin/python2.2
Python 2.2.2 (#1, May 29 2003, 17:09:39)
[GCC 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>from mod_python import apache
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", line 
67, in ?
    import _apache
ImportError: No module named _apache
>>>import mod_python
>>>from mod_python import apache

Wierd !!!

<Directory "/www/bi/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    #AddHandler python-program .py this was a problem
    AddHandler cgi-script .py
    PythonHandler mod_python.publisher
    PythonDebug On


#! /usr/local/bin/python2.2

import MySQLdb
import sys

from mod_python import apache
from HtmWindow import getHtmlWindow

def query(req):

blah blah blah

ninemsn Extra Storage is now available. Get larger attachments - 
send/receive up to 2MB attachments (up to 100 percent more per e-mail). Go 
to  http://join.msn.com/?page=dept/home&pgmarket=en-au

More information about the Mod_python mailing list