Re: python_handler: Can't get/create interpreter

Fred <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
2009/2/26 Graham Dumpleton <[email protected]>

> 2009/2/27 Fred <[email protected]>:
> > 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

_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.