[mod_python] mod_python, python_handler error "Can't get/create interpreter"

Graham Dumpleton graham.dumpleton at gmail.com
Mon Apr 23 18:02:00 EDT 2007


On 24/04/07, Sean Glover <seanglover at sympatico.ca> wrote:
> Hello, I recently started using python 2.5 on my FreeBSD machine.  I had a
> version of mod_python up and running (sorry, I don't recall which one)
> against python 2.4.  I used the ports packages system to install mod_python
> 3.3.1 without incident.  It replaced the old mod_python.so module and put
> the necessary python modules in my python2.5 site-packages directory.  I
> left my httpd.conf configuration the same, restarted,

When replacing mod_python version, always a good idea to do a 'stop'
and 'start' rather than a 'restart', but presuming you would have
eventually tried that.

> and hit my mod_python
> test page and receive an internal server error.  Below is a paste from my
> httpd-error.log.
>
> Could anyone suggest a solution to get mod_python (with python 2.5) working
> with my apache 2.2 server again?

How many versions of Python do you have installed on your system?

I would probably guess you have older version of Python in /usr/bin
still and Python when being initialised within mod_python is finding
that old version, but the old version doesn't have the mod_python
Python bits.

Try setting the PATH environment variable for the user that runs
Apache to have /usr/local/bin first in the path so that it finds the
version of Python you want used before the operating system default
version.

BTW, are you sure there weren't a series of other error messages prior
to those you quoted. Can you include the dozen of so lines before that
point?

Graham

> # mod_python.so module
>
> -rwxr-xr-x  1 root  wheel  122135 Apr 23 12:43
> /usr/local/libexec/apache22/mod_python.so
>
>
>
> # mod_python python modules (/usr/local/lib/python2.5/site-packages)
>
> drwxr-xr-x   2 root  wheel    1024 Apr 23 12:43 mod_python
>
> -rw-r--r--   1 root  wheel     254 Apr 23 12:43
> mod_python-3.3.1-py2.5.egg-info
>
>
>
> # apache httpd.conf file entry
>
> LoadModule python_module libexec/apache22/mod_python.so
>
>
>
> # test .htaccess
> (http://randonom.com/test/python/mptest.py)
>
> AddHandler mod_python .py
>
> PythonHandler mptest
>
> PythonDebug On
>
>
>
> # httpd-error.log after hitting the URL above ^
>
> [Mon Apr 23 13:37:40 2007] [error] get_interpreter: no interpreter callback
> found.
>
> [Mon Apr 23 13:37:40 2007] [error] [client 65.36.178.226] python_handler:
> Can't get/create interpreter.
>
>
> _______________________________________________
> 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