[mod_python] Install Question

Graham Dumpleton graham.dumpleton at gmail.com
Sun Mar 11 22:28:12 EST 2007


Are you absolutely sure that the mod_python files in Python
site-packages are those for the version of mod_python you are using?

The error messages indicate that a recent version of mod_python is
installed but that it is finding an old version of mod_python Python
code files in site-packages. This is evident as mod_python is trying
to pass two arguments to the init() function but the Python code files
aren't expecting any. The change to passing two arguments occurred
sometime in mod_python 3.2.X versions.

If the site-packages has correct versions, then speculate that you
have two versions of Python installed and old version of mod_python
files is in the version of Python you didn't want used. If the version
of Python you want used is in a non standard spot, you will need to
change the PATH inherited by the Apache process such that the python
executable you want used appears first in the PATH before than in
/usr/bin.

Graham

On 12/03/07, Jon McLachlan <mcla0181 at umn.edu> wrote:
> Hi,
>
>   I am trying to install mod_python on apache 2.2.4, running SuSE (uname
> -a = Linux neo 2.6.16.27-0.6-default #1 Wed Dec 13 09:34:50 UTC 2006
> i686 i686 i386 GNU/Linux).  I have not encountered any strange behavior
> while following the documented install process described at
> http://www.modpython.org/live/current/doc-html/inst-compiling.html.  I
> am primarily interested in installing mod_python as a DSO on apache,
> because my primary use is for trac.  Whenever I attempt to use the
> mod_python handler for a specific Directory, Location, or VM as defined
> in the apache's configuration, it returns an internal server error to
> the client.  Further, the error_log reports the following:
>
> [Sun Mar 11 21:53:30 2007] [error] make_obcallback: could not call init.\n
> TypeError: init() takes no arguments (2 given)
> [Sun Mar 11 21:53:30 2007] [error] make_obcallback: mod_python version
> mismatch, expected '3.3.1', found '<unknown>'.
> [Sun Mar 11 21:53:30 2007] [error] make_obcallback: mod_python modules
> location '/usr/lib/python2.4/site-packages/mod_python/__init__.pyc'.
> [Sun Mar 11 21:53:30 2007] [error] get_interpreter: no interpreter
> callback found.
> [Sun Mar 11 21:53:30 2007] [error] [client 63.231.137.166]
> python_handler: Can't get/create interpreter.
>
> The trouble shooting guide at
> http://www.modpython.org/live/current/doc-html/inst-trouble.html did not
> help much.
> The FAQ seemed hopeful at first, but after the faq for "init" redirected
> me to http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.001.htp I
> am still yet to resolve this issue.
>
> I am certain that the files in
> "/usr/lib/python2.4/site-packages/mod_python/*" are accessible by the
> apache username/group.  I know that adding a PYTHONHOME env variable for
> apache, only complicates things by making the module unloadable (even
> when this points to the correct, and readable&executable, python dir,
> because apache always seems to mangle the path while, this is funny,
> "looking for python").  I have tried "strace httpd -X" but, I have not
> discovered any extra clues as to what is going on - only similar
> information as described above in the error logs.  I am entirely perplex
> by the elusive culprit behind this bug.  I know that it must ultimately
> be something I am not understanding, though, so here I plead to a more
> practiced group.
>
> Any thoughts, comments, or advice are greatly appreciated.
>
> Best Regards,
> ~Jon
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list