Aaron Lelevier
Aaron Lelevier

Reputation: 20770

mod_wsgi compiled in python 2.7.3 and runtime in python 2.7.4

I am trying to get my Apache server to run mod_wsgi and am getting this error:

[Fri Jul 19 10:24:05 2013] [warn] mod_wsgi: Compiled for Python/2.7.3.
[Fri Jul 19 10:24:05 2013] [warn] mod_wsgi: Runtime using Python/2.7.4.

Is this fixed by going into /usr/local/src where Python is located and running:

./configure --enable-shared
make install

What I have read so far seems like the fix needs to be that mod_wsgi has to have access to all Python libraries, and thus running the --enable-shared command will allow it to work. After i see the above [warn] lines in my Apache error.log, it then says that it can't look up environmental variables in my DJANGO_SETTINGS_MODULE settings.py file. When I replace those variables, it then says that it can look up other Python packages in other places.

I am running Ubuntu Linux 13.04 on a Rackspace VPS, Using Django 1.5.2 and on my local machine have Python 2.7.3 but the native Python to the Rackspace VPS is 2.7.4. The mod_wsgi version I am currently using is 3.4

I found this link

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

In the section "Python Patch Level Mismatch" it seems to say that I have to rebuild mod_wsgi, but this sounds somewhat difficult so wanted to ask if there is an easier fix?

Thank you in advance,

Upvotes: 2

Views: 3008

Answers (2)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

You do not have to rebuild anything if mod_wsgi was originally linked against a Python shared library vs static. The documentation you references says that:

This would generally not be a problem provided that both versions of Python were originally installed with the '--enable-shared' option supplied to 'configure'. If this option is used then the Python library will be linked in dynamically at runtime and so an upgrade to the Python version will be automatically used.

Since you are using system installed packages, they should be using a shared library and so there should be no issue.

You can verify by following the procedure listed at:

Upvotes: 0

Shani
Shani

Reputation: 418

It is not complicated to build mod_wsgi.

However if you are using your distributions default python usually your distribution will package mod_wsgi such that it will already work.

Delete the mod_wsgi you uploaded to the server.

On ubuntu try:

apt-get install libapache2-mod-wsgi

restart apache and then it should work.

Upvotes: 5

Related Questions