[mod_python] With OS X and Python 2.4 - installed but not working

Graham Dumpleton grahamd at dscpl.com.au
Wed Dec 22 23:40:51 EST 2004

For ideas, run something like:

  otool -L /usr/local/apache-2.0/modules/mod_python.so

What does it output for you?

For me it generates:

        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.1.1)
        /System/Library/Frameworks/Python.framework/Versions/2.3/Python (compatibility version 
2.3.0, current version 2.3.0)

But then that is correct in my case as I patched mod_python so it will
work with standard Python 2.3 shipped with Mac OS X, thus avoiding
building Python 2.4 and trying to get it to work. :-)

Then look at the dyld manual page. You might find you have to set the
DYLD_FRAMEWORK_PATH environment variable so that otool/httpd
will look in the correct place for your framework for Python 2.4. It
is probably simply ignoring your new version and still using the old.

BTW, the patches required for mod_python so it will work with Python
2.3 shipped with Mac OS X can be found amongst other patches at:


On Dec 22 22:11, Jason Stitt <jason at pengale.com> wrote:
> Subject: [mod_python] With OS X and Python 2.4 - installed but not working
> I am trying to get fresh source builds of Apache 2.0.52, Python 2.4 and 
> Mod Python 3.1.3 -- that is, all the latest stable versions -- working 
> on my Mac (OS X 10.3.7). I'm putting them in a separate directory 
> ~/server (so as not to mess around with the factory-default 
> installations). It's not quite working.
> Apache went in fine. I tried to install Python normally, but it refused 
> to create a libpython for me (which mod_python said it needed), even 
> with the --enable-shared configuration flag. So I made it a framework 
> under ~/server/frameworks. In both cases, the python interpreter itself 
> worked fine.
> Then came mod_python. Once I did the framework install of python, it 
> compiled OK. I gave it a --with-python flag pointing at the executable 
> in my framework install. I have added the LoadModule to my config file, 
> which looks like this:
> LoadModule python_module 
> /Users/jason/server/apache2/modules/mod_python.so
> <Directory /Users/jason/server/apache2/htdocs>
>          AddHandler mod_python .py
>          PythonHandler mod_python.publisher
>          PythonDebug On
> </Directory>
> The server string reads:
> Apache/2.0.52 (Unix) mod_python/3.1.3 Python/2.3 Server at localhost 
> Port 8000
> Note the odd inclusion of Python/2.3. I checked mod_python's makefile 
> and it references only my shiny new python 2.4 directory.
> Anyway, whenever I try to actually visit a python page, it either 
> hangs/times out, or gives me a 500 internal server error. Nothing is 
> written to the error_log.
> Anyone experienced with this type of build on OS X? Any ideas?
> Thanks much,
> Jason
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

Graham Dumpleton (grahamd at dscpl.com.au)

More information about the Mod_python mailing list