[mod_python] Using mod_python with MacOSX Tiger/Leopard.

Graham Dumpleton graham.dumpleton at gmail.com
Mon Mar 10 20:44:00 EDT 2008

For those users of MacOS X out there who have been having problems, or
moaning about  the state of Python/Apache/mod_python on MacOS X, I set
you a challenge. Since you seem to be unwilling to come up with
patches to fix the problems, or just aren't in a position to work out
what the packages required might be, then please at least do the

1. Using a subversion client, checkout latest mod_python source code from trunk:

  svn co http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk

2. Build the source code on your MacOS X system, whether that be Tiger
or Leopard and whether you be using the standard OS installation of
Python or an alternate version such as from MacPorts. Ensure you use
--with-python to point at the version of Python you want to use. Use
--with-apxs as necessary.

3. Install it and see if it works without you having to have made any
changes to the source code. If you have multiple versions of Python
installed on your system, try it with all of them to make sure all
work. Just ensure you do a full 'stop' of Apache between testing each
version. If you don't have code which will work with that version of
Python, just use the mod_python testhandler.

<Location /testhandler>
SetHandler mod_python
PythonHandler mod_python.testhandler

4. Respond with your results about what works and what doesn't.

Hopefully the source in subversion trunk will now build on both Tiger
and Leopard out of the box and deal with Python installations being in
different locations. It also shouldn't pick up the wrong framework
where multiple framework versions of Python are installed. On Leopard,
it should also ensure that the mod_python.so file and the psp C
extension module are built with the same architectures that your
Apache binary is built with.

Do note, I haven't myself been able to set this on Tiger yet, but
believe it should work. Also, because this affects the main build
process and because I replaced whole sections of configure script code
with stuff from mod_wsgi which I know works properly, then building
code for other platforms may also be affected. Thus, if you have
access to other platforms besides MacOS X, then test it there as well.

So rather than complaining, here is your chance to help out and
improve the situation. :-)

BTW, Apple has documented the issues with building Python C extension
modules for additional architectures. It can be found at:


This is referenced along with other stuff about the sorts of problems
that crop up on MacOS X at:



More information about the Mod_python mailing list