[mod_python] not using correct python library path

Jim Gallacher jpg at jgassociates.ca
Wed Sep 6 15:30:48 EDT 2006


Grant Kelly wrote:
> Hello,
> 
> I'm having a problem with mod_python.
> 
> I have two versions of python:
> 
>  The system version: /usr/bin/python (2.3)
>  Local installed version: /usr/local/bin/python (2.4)
> 
> I configured mod_python with:
> ./configure --with-apxs=/usr/sbin/apxs
> --with-python=/usr/local/bin/python2.4
> --with-python-src=/usr/local/src/python
> ----------------------
> 
> But when I try to use mod_python, I receive the following in the
> apache error log:
> 
> [Wed Sep 06 10:23:12 2006] [error] make_obcallback: could not import
> mod_python.apache.\n
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py",
> line 24, in ?
>    import pdb
>  File "/usr/lib/python2.3/pdb.py", line 13, in ?
>    import re
>  File "/usr/lib/python2.3/re.py", line 5, in ?
>    from sre import *
>  File "/usr/lib/python2.3/sre.py", line 97, in ?
>    import sre_compile
>  File "/usr/lib/python2.3/sre_compile.py", line 17, in ?
>    assert _sre.MAGIC == MAGIC, "SRE module mismatch"
> AssertionError: SRE module mismatch
> --------------------

That looks completely messed up. The path for apache.py in the traceback 
seems to indicate that apache is using python2.4, but then it quickly 
goes pear shaped. What happens if you do the following from the command 
line?

$ /usr/local/bin/python2.4
 >>> import pdb

By the way, you don't need --with-python-src. Thats only required for 
building the docs, which are already included in the source tarball.

Jim


More information about the Mod_python mailing list