[mod_python] Re: mod_python and no Python.framework on the Mac

Graham Dumpleton graham.dumpleton at gmail.com
Wed Jan 30 01:55:11 EST 2008

On 30/01/2008, Brad Anderson <brad at dsource.org> wrote:
> Hi Graham,
> I've found this article:  http://www.modpython.org/pipermail/mod_python/2007-September/024205.html
> about how I need to doctor up src/Makefile's LDFLAGS to add -Wl,-F/
> some/path/lib
> where /some/path/lib is where your Python 2.5 framework library is
> installed.
> Thing is, I don't have a Python framework.  I had the one that comes
> with Mac in /System/Library/Frameworks/Python.framework, but I've
> moved it aside, b/c I used MacPorts python25.  It put things into /opt/
> local/, but there's no /opt/local/Library/Frameworks, and also nothing
> pythonic in /Library/Frameworks...
> So, I changed the ldflags path to /opt/local/lib
> Here's otool:
> Macintosh:apache2 root# pwd
> /opt/local/apache2
> Macintosh:apache2 root# otool -L modules/mod_python.so
> modules/mod_python.so:
>          /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
> current version 111.0.0)
>          /opt/local/lib/libpython2.5.dylib (compatibility version
> 2.5.0, current version 2.5.0)
>          /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
> current version 1.0.0)
> So, I'm thinking that is looking pretty good.
> However, I still get a 500 error, and the following in the Apache
> error log:
> [Wed Jan 30 00:28:22 2008] [error] [client] python_handler:
> Can't get/create interpreter.
> Any advice?

Yes, use the mailing list for questions. :-)

Oh, and have you actually installed the Python site-packages
components of mod_python.

You can work this out by running actual version of Python you think is
supposed to be used.

$ python
Python 2.5.1 (r251:54863, Oct  9 2007, 20:39:46)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mod_python

If you get the error shown, it isn't installed properly. If you don't
get it, send all the mod_python related error messages from Apache,
not just that one, the others are there specifically to help debug

BTW, since Leopard has Python 2.5.1, was there really a pressing need
to install the one from MacPorts.

Please keep followups on the mailing list by using reply-all.


More information about the Mod_python mailing list