Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WSGI with a specific python binary

Can wsgi be configured to use a specific python executable?

When using the WSGIPythonHome directive, you supply a prefix. What does mod_wsgi look for in that directory? I assume it looks in the supplied directory for the executable ../bin/python . If the executable is called, say, python26, will it be found? I assume not.

(Details: The system python on the server I'm using is 2.4 and I'm trying to upgrade. I don't have sudo on the machine, and I'm trying to work with my admin on this... I'm not sure why we can't just install the new version of python in /opt or /usr/local with the standard directory structure, so we can use WSGIPythonHome in the normal way, which is what I would do. I'm just trying to work with him and be agreeable.)


Alternatively, does mod_wsgi just use the python binary it was compiled against? So if we recompile mod_wsgi with the new version of python, will it always use that one?

like image 800
jmilloy Avatar asked Jun 15 '26 10:06

jmilloy


1 Answers

Yes, you must recompile mod_wsgi from source code against version/installation of Python you wish to use. See:

http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions

and:

http://code.google.com/p/modwsgi/wiki/InstallationIssues#Unable_To_Find_Python_Shared_Library

like image 105
Graham Dumpleton Avatar answered Jun 18 '26 01:06

Graham Dumpleton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!