[mod_python] python_handler: Can't get/create interpreter

Fred dofre1680 at gmail.com
Fri Feb 27 05:27:36 EST 2009


2009/2/26 Graham Dumpleton <graham.dumpleton at gmail.com>

> 2009/2/27 Fred <dofre1680 at gmail.com>:
> > When i look at log i have (for each request) :
> > [Thu Feb 26 19:46:29 2009] [error] [client X.X.X.X] python_handler: Can't
> > get/create interpreter
>
> Most likely because you have multiple versions of Python installed in
> different root locations and when mod_python tries to initialise the
> Python interpreter it is finding the root directory for the wrong one
> and so cannot find the installed files for the correct one.
>
>
> Find the 'envars' file in same directory as 'httpd' for Apache which
> is being used and add:

this file is not present so i use the second choice you explain.

>
>
>  PYTHONHOME=/freeware/python-2.5.4
>  export PYTHONHOME
>
> The file should be present if compiled Apache from source code. If you
> are using a package Apache then it may not exist because they screwed
> with Apache layouts. In that case you have to find the right init.d
> startup file for Apache and hack it into there.

i add it (export PYTHONHOME=/freeware/python-2.5.4) to my init.d apache2
script and it's works!!!
great :)


>
>
> Restart Apache.
>
> BTW, if using a web application which supports WSGI, you would be
> better off using mod_wsgi. It is a bit more friendly as far as
> overriding this sort of problem as one can set a directive in the
> Apache configuration itself to indicate where Python is installed.
> See:
>
>
> http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions
>
> Just don't run mod_python and mod_wsgi at the same time though else
> that directive will not work as mod_python still overrides things.

The application  i have to maintain use this 2 modules at the same time, i
think, because they are loaded in conf of apache.
It use cgi for the first part (python script with mod_python) and wsgi with
pylons on second part.
so i have to read some documentation to understanding apache conf with
mod_python and modwsgi use at the same time....
Thanks a lot for your help!
fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20090227/0b9d4715/attachment.html


More information about the Mod_python mailing list