Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The following is what appears in my error_log:

[Sat Nov 17 23:13:14 2012] [warn] mod_wsgi: Compiled for Python/2.7.3.
[Sat Nov 17 23:13:14 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.

If I check my $PATH variable and even in /etc/paths, /usr/local/bin (which contains Python 2.7.3) comes before /usr/bin (which contains Python 2.7.2).

Is there some other path that I'm missing out on? How can I get the correct runtime to be used?

share|improve this question
Just as a clarification this is on Mac OS X 10.8 running the pre-installed version of Apache 2. – Ian William Kohl Nov 18 '12 at 14:32
I see you've already solved it - but as information, your own $PATH will not affect a service started from launchd or using a script that sets its own path or that is started with e.g. sudo. – Jenny D Sep 9 '13 at 11:19

I was able to determine the reason why the older runtime was used.

The quick fix was to symlink /usr/bin/python (which was originally 2.7.2) to /usr/local/bin/python where the newer version of Python is making /usr/bin/python also 2.7.3. Upon restarting Apache, 2.7.3 was used meaning somehow /usr was being used over /usr/local. However, I didn't want to stick with this as the solution, so I removed the symlink.

After some further digging, I looked at the apachectl script and was able to determine that it was loading environment variables for Apache from /usr/sbin/envvars

I modified the following line of the envvars file to include /usr/local/lib and restarted Apache. It loaded with Python 2.7.3 (thus solving a separate issue with _uname I was having with Django that is caused by 2.7.2/2.7.3 discrepancies)

share|improve this answer
More likely should be rebuilding mod_wsgi from fresh source code and use the --disable-framework to configure. Still don't know why for some people the linker doesn't link in reference to correct framework, but using that configure option usually helps. – Graham Dumpleton Nov 18 '12 at 22:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.