[mod_python] import _apache fails

Markus Demleitner msdemlei at cl.uni-heidelberg.de
Fri Apr 19 09:26:12 EST 2002


On Thu, Apr 18, 2002 at 03:49:37PM -0700, Sean Abrahams wrote:
> Going through the docs, testing my mod_python install and getting this
> message in the apache logs:
> 
> File "mptest.py", line 3, in ?
> from mod_python import apache
> File "/usr/lib/python2.1/site-packages/mod_python/apache.py", line 55, in ?
> import _apache
> ImportError: No module named _apache
> 
> I've looked around and found something in regards to this won't work
> from the command line, but as I stated, this is from the apache error
> log, generated when calling the script from the web.
> 
> Running:
> Debian Testing / GNU/Linux 2.2.17
> Apache 1.3.9-14 / Mod Python 2.7.6-1
> 
> I used apt-get to grab and install modpython.

Chanches are your mptest.py is not executed as a handler but as a
CGI -- check your httpd.conf and make sure there's something like
  AddHandler python-program .py
	PythonHandler unimut_modpython
in there and that the directives are active for whatever directory
your mptest.py is in.

    Markus



More information about the Mod_python mailing list