3

My WSGI installation uses python2.6 and my django project requires python 2.7 to work properly. Is is possible to relink the python version WSGI uses without recompiling wsgi? I've been having some odd errors trying to compile wsgi and I'd prefer to sidestep that whole troubleshooting process if possible.

Thanks

1
  • have you tried using other WSGI servers, such as gunicorn or CherryPy? Commented Jun 28, 2011 at 16:26

2 Answers 2

4

To answer the specific question, no it is not possible to make a mod_wsgi installation compiled for one Python version to use a different version at run time.

Why don't you create a separate question for the actual problem you are having with compiling from source code. Better still ask it on the mod_wsgi mailing list where best people to help you can be found.

Sign up to request clarification or add additional context in comments.

2 Comments

true about 2.6->2.7, but can minor version differences cause a problem for compiled wsgi module?
As documented in code.google.com/p/modwsgi/wiki/… so long as a shared library for Python is used a difference in patch revision is usually okay. But if you didn't build Python with a shared library and it is linked statically, you do open yourself up for problems as even though you upgrade to newer patch revision of Python, mod_wsgi will still statically link the older versions library.
3

You'll have to re-install WSGI with something like this directive

./configure --with-python=/usr/local/bin/python2.7

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

If you're running multiple applications, it might be a good idea to use virtualenv and set the os.environ variables in your applications' WSGI scripts to point to their virtual environments.

1 Comment

There are no variables you can set with os.environ within a WSGI script file to effect which virtual environment you are using so not sure what you are talking about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.