[mod_python] mod_python.so: undefined symbol: ap_loaded_modules

Graham Dumpleton grahamd at dscpl.com.au
Tue Nov 15 23:25:46 EST 2005

Jim Gallacher wrote ..
> Mark Dokter wrote:
> > Hello!
> > 
> > I have a messed up python/mod_python installation. First, the apache
> log gave 
> > me: [error] make_obcallback: could not import mod_python.apache.\n
> This indicates that apache was able to load the mod_python.so apache 
> module, but can't find the mod_python python modules.
> To test this try the following from a commond line interpeter:
>  >>> from mod_python import apache
> If you see mention of  "ImportError: No module named _apache" then you
> are in good shape. If you see something else then it means python can't
> find the mod_python modules. Let us know what you get.
> The standard location for the mod_python python modules on Debian is 
> /usr/lib/python2.3/site-packages/mod_python/. If they are not there then
> your installation is truly messed up.

A random bit of information that may not be relevant, but if you have
multiple versions of Python installed and the one which is first in your
PATH is not the same one as mod_python was built for, and you run
"apachectl restart" or "apachectl start" explicitly, mod_python can fail
because it will use the one found in PATH and not the one it was built

The reason for failure can be because the one found doesn't have the
mod_python Python code components installed for it, or it has a
different version mod_python Python code components which are

You may get a better indication of what the problem is if you were using
mod_python 3.2 (BETA) as older versions didn't always write out or flush
out error messages properly which gave an indication of the true reason
for the error. You may also only find error messages in the Apache log
file appearing when you later shut Apache down. Ie., they don't end up
in the log at time of startup when the problem occurs, but when buffers
flushed on shutdown.


More information about the Mod_python mailing list