[mod_python] not using correct python library path

Grant Kelly gkelly at gmail.com
Wed Sep 6 13:34:53 EDT 2006


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
--------------------

So it appears that python is trying to import modules from the
python2.3 library path. How can I force it to use the python2.4
library path, /usr/local/lib/python2.4 ?

Thanks in advance,
Grant


More information about the Mod_python mailing list