[mod_python] mod_python.so: undefined symbol: ap_loaded_modules

Jim Gallacher jpg at jgassociates.ca
Tue Nov 15 20:52:14 EST 2005

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.

> Then I tried to import mod_python from the python interpreter. I noticed 
> that /usr/lib/apache2/modules was not in sys.path, so I added it, then I got 
> the following error: 
> ImportError: ./mod_python.so: undefined symbol: ap_loaded_modules

mod_python.so is an apache module, not a python module, so it makes no 
sense to put /usr/lib/apache2/modules in your sys.path.

Check the following FAQs:


Graham has a nice article which you may also find useful.



> Does somebody have a clue, because I don't :(
> My setup:
> Debian testing, kernel 2.6.12
> python/testing 2.3.5-3
> libapache2-mod-python/testing 3.1.3-3
> apache2/testing 2.0.54-5
> sys.path:
> ['', '/usr/local/lib/python23.zip', '/usr/local/lib/python2.3', 
> '/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk', 
> '/usr/local/lib/python2.3/lib-dynload', 
> '/usr/local/lib/python2.3/site-packages', '/usr/lib/apache2/modules', 
> '/usr/lib', '/usr/lib/python2.3', '/usr/lib/python2.3/site-packages']
> Thanks in advance,
> Mark
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list