[mod_python] Test fails on Mac OS X, Apache 2.0, mod_python 3.2.8

Graham Dumpleton grahamd at dscpl.com.au
Sun Mar 26 19:40:16 EST 2006

Todd O'Bryan wrote ..
> After fighting a long time with Apache (Mac OS X Server is really  
> nice, but figuring which version of Apache I'm running--the built-in  
> 1.3 or my own install--was a major pain), I finally have a 2.0  
> version serving pages. But when I tried to get mod_python working, I  
> got this error:
> [Sun Mar 26 19:12:01 2006] [error] make_obcallback: could not import  
> mod_python.
> apache.\n
> Traceback (most recent call last):
>    File "/sw/lib/python2.4/site-packages/mod_python/apache.py", line  
> 24, in ?
>      import pdb
>    File "/sw/lib/python2.4/pdb.py", line 11, in ?
>      from repr import Repr
>    File "/sw/lib/python2.4/repr.py", line 6, in ?
>      from itertools import islice
> ImportError: Failure linking new module: /sw/lib/python2.4/lib- 
> dynload/itertools
> .so: Symbol not found: __PyArg_NoKeywords
>    Referenced from: /sw/lib/python2.4/lib-dynload/itertools.so
>    Expected in: dynamic lookup
> Believe it or not, Google returned NO pages for __PyArg_NoKeywords.  
> Any ideas?

Are you confident that you built mod_python for Python 2.4 from fink
and not against the version of Python distributed with Mac OS X?

Having multiple version of Python available can often be a problem as
Apache/mod_python will attempt to use the one found in $PATH of
user Apache is started as and not that which mod_python was compiled
against. This can result in a unhealthy mix of stuff from different versions
of Python being used.

Thus, confirm which version of Python you build mod_python with and
ensure that that version appears in $PATH before any others when
Apache is restarted.

Further, on Mac OS X it doesn't properly unload the Python framework
on a "restart". Thus, after recompiling/reinstalling mod_python it is always
a good idea to do a "stop" and "start" rather than a "restart" of Apache.

If this helps, please feedback details about what the problem turned out
to be. This problem is occassionally seen, but we don't usually get any
details back about why so we can add it to our knowledge bank.


More information about the Mod_python mailing list