[mod_python] not using correct python library path

Grant Kelly gkelly at gmail.com
Wed Sep 6 16:05:05 EDT 2006


I think I've solved my problem with mod_python. It had to do with
having a manual PYTHONPATH specified for root versus the user I
compiled mod_python with. root was using python2.3 (to run `make
install`) and the user was using python2.4, so mod_python.so was
compiled for 2.4 but when it ran, it was using the 2.3 library path.
This is my best guess at what happened...could be wrong, but it seems
to be working now.

Thanks,
Grant


On 9/6/06, Jim Gallacher <jpg at jgassociates.ca> wrote:
> 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