[mod_python] problems installing on OS 10.5

Dan Yamins dyamins at gmail.com
Sun Mar 8 22:26:43 EDT 2009

Hi, I'm having problems building mod_python on Mac OS10.5.

Here's how the problem arose:

1) I got source for the 3.3.1 release.  I built the source following the
directions on the website (
http://www.modpython.org/live/current/doc-html/inst-compiling.html).    The
build seemed to have gone fine.

2) Then, I tried to configure apache.   At the end of the make install
process, it told me to add the following line to  my httpd.conf file:

   LoadModule python_module        libexec/apache2/mod_python.so

I did this, and then restarted apache.

3) At this point, I began to get the message "Firefox can't establish
connection to server..." for all the servers served by apache on my machine.

4) So, I ran the command apachectl -t .   This produced the following

"syntax error on line 116 of /private/etc/apache2/httpd.conf: Cannot load
/usr/libexec/apache2/mod_python.so into server:
dlopen(/usr/libexec/apache2/mod_python.so, 10): no suitable image found.
Did find:\n\t/usr/libexec/apache2/mod_python.so: no matching architecture in
universal wrapper"

5) So I looked up this error on google.  Apparently this is a known problem
(see e.g.
It was suggested that the the problem is that "the compiler is not creating
a full fat version of the Apache module for mod_wsgi and when it is loaded
into Apache, it can't find correct version for the architecture."

I followed these instructions here:
(-- albeit they're for wsgi, but shold be similar for mod_python).

After modifying the Makefile and redoing make && sudo make install, it still
does not work.  I still get the same error from apachectl, and
running "file /usr/libexec/apache2/mod_python.so"  shows that I still don't
have 64bit binaries:

"/usr/libexec/apache2/mod_python.so: Mach-O universal binary with 2
/usr/libexec/apache2/mod_python.so (for architecture i386):    Mach-O bundle
/usr/libexec/apache2/mod_python.so (for architecture ppc):    Mach-O bundle

6) So, what do I do?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20090308/ec9d3101/attachment.html

More information about the Mod_python mailing list