title: Can't recompile mod_wsgi with Python 2.7
body: <p>I am finding it impossible to recompile mod_wsgi for python 2.7.</p>
  
  <p>I am building an application using Flask and Flask-WTF. It works fine as a standalone but breaks in Apache because the the Apache server on my mac is using Python 2.6, even though 2.7 is installed and used in python apps by default. The standalone uses 2.7.</p>
  
  <p>which python shows this:</p>
  
  <pre><code>/Library/Frameworks/Python.framework/Versions/2.7/bin/python
  </code></pre>
  
  <p>otool -L mod_wsgi.so showed this:</p>
  
  <pre><code> mod_wsgi.so:       
  
      /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
  </code></pre>
  
  <p>So I recompiled:</p>
  
  <p>./configure with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python</p>
  
  <p>otool -L mod_wsgi.so shows no change:</p>
  
  <p>/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)</p>
  
  <p>After a restart, Apache was still using 2.6 as confirmed both by phpinfo() and error logging. The Apache details from phpinfo() are as follows:</p>
  
  <pre><code>Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.4 Python/2.6.1 PHP/5.3.15 mod_ssl/2.2.22 OpenSSL/0.9.8r
  </code></pre>
  
  <p>It is using modules found at this path: /Library/Python/2.6/site-packages/. There is no 2.7 directory in /Library/Python.</p>
  
  <p>I have tried fiddling with the WSGIPythonHome variable in httpd.conf, but nothing works.</p>
  
  <p>I also compiled mod_wsgi with the disable-framework command. This did not fix the problem either.</p>
  
  <p>Is there something else I need to change in my Apache configuration to point it to the right python version, or do I need to add something extra to my mod_wsgi configuration? Installing the modules I am using into 2.6 isn't an option. </p>
  
  <p>I am running Apache 2 on Mac OSX 10.6.8</p>
  
  <p>Thanks. </p>
  
  <hr>
  
  <p>Here's the full solution.</p>
  
  <pre><code>cd &lt;mod_wsgi source directory&gt;
  
  make distclean
  
  ./configure --with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python --disable-framework
  
  sudo make install
  </code></pre>