[mod_python] mod_python cannot find Python 2.4 --

Graham Dumpleton grahamd at dscpl.com.au
Mon Jul 10 18:34:02 EDT 2006


J. Jeffrey Close wrote ..
> 
> Hi,
> 
> This problem is fairly well-known, but I've tried all the suggestions that
> I've seen online and none have helped.
> 
> mod_python 3.2.8 from Source
> python 2.4.3
> apache 2.0.58
> 
> It's the usual "new version of Python framework" problem.  I have installed
> Python 2.4.3 with the Universal install that installs it under /Library/Frameworks/Python.framework/Versions/{2.4,
> Current} .  I built mod_python with
> ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python <above
> path>/bin/python2.4
> 
> When I run apache, the logs show 
> "mod_python/3.2.8  Python/2.3.5 configured -- resuming normal operation"
> 
> I have tried with and without the configure options above.  I have done
> 'otool -L mod_python.so' and it reports also 2.3.5.  No matter what I've
> tried, otool/httpd refuse to see the new Python.  HOWEVER, when I build
> mod_python, everything reports python 2.4.3 in the configure and the build
> -- i.e. there is no indication that it's not finding any of 2.4.   
> 
> Any ideas?   Thanks for any help.

When Apache is started, the Python initialisation performed from inside
of mod_python will look through directories in PATH trying to find a
"python" binary. It somehow uses the location of this to determine how
it will setup sys.path etc. This often results in wrong Python lib
directory being referenced for the version of Python being loaded. On
Mac OS X it gets further complicated because of the framework stuff.

End result is that you may have to ensure that the bin directory in the
Python framework directory for Python 2.4 is at start of PATH of the
environment of the user starting Apache.

Graham



More information about the Mod_python mailing list