[mod_python] PYTHONPATH and mod_python

Soenke Ruempler - NorthClick soenke.ruempler at northclick.de
Thu Dec 21 06:57:56 EST 2006


Hi Martin,

Martin Stoufer <mailto:MCStoufer at lbl.gov> wrote on Wednesday, December 20,
2006 6:13 PM:

> The simplest, and most evil, answer to this is after reboot
> a different
> version of python is being used that does not have the
> mod_python module
> installed in its site-packages tree. From your helpful traceback, it
> looks like the installed mod_python lib in Apache is still
> healthy and
> being loaded properly.
> 
> Was this the same version as your were running pre-reboot? If so,
> something serious happened to the entire mod_python module.

The python binaries are the same as before the reboot. But, maybe worth a
note, there is more than one binary:

lrwxrwxrwx  1 root root       9 Nov 29 17:21 /usr/bin/python -> python2.3*
-rwxr-xr-x  1 root root 1855364 Nov 25  2004 /usr/bin/python1.5*
lrwxrwxrwx  1 root root       9 Mar 11  2005 /usr/bin/python2 -> python2.3*
-rwxr-xr-x  1 root root 3206789 Nov 25  2004 /usr/bin/python2.0*
-rwxr-xr-x  1 root root    6364 Nov 24  2004 /usr/bin/python2.3*
-rwxr-xr-x  1 root root 4135506 Sep 22 18:04 /usr/bin/python2.5*
-rwxr-xr-x  1 root root     178 Nov 24  2004 /usr/bin/python2.5-config*
lrwxrwxrwx  1 root root      16 Nov 29 17:21 /usr/bin/python-config ->
python2.5-config*

However, the config line für mod_python is:

./configure --with-python=/usr/bin/python2.5
--with-apxs=/www/94219_27474/local/apache2/bin/apxs
--prefix=/www/94219_27474/local/ --libdir=/www/94219_2747

IMHO it must be something with the PYTHONPATH that isn't properly put into
Apache. I tried almost everything like

# PYTHONPATH=... apachctl restart
# env apachectl restart
# export PYTHONPATH=...

And northing seems to help ...


-soenke




More information about the Mod_python mailing list