title: apache2 - runs python 2.6, instead of 2.7
body: <p>I'm trying to set up apache2 web server for Odoo. The only problem I got is it does not run correct version of python. I'm using squeez linux distribution, so default version is 2.6. But I need 2.7. So I installed it separately and I could run it using virtualenv just fine (before I had set Odoo server using that approach). Now I need to do the same, but also need to introduce apache2. But for some reason it always runs python 2.6 and with that Odoo (v8) fails to start, because it requires python 2.7.</p>
  
  <p>So when I start apache2 and try to open server address, I get this error:</p>
  
  <pre><code>mod_wsgi (pid=32341): Target WSGI script '/opt/odoo/openerp-wsgi.py' cannot be loaded as Python module.
   mod_wsgi (pid=32341): Exception occurred processing WSGI script '/opt/odoo/openerp-wsgi.py'.
   Traceback (most recent call last):
     File "/opt/odoo/openerp-wsgi.py", line 22, in &lt;module&gt;
       import openerp
     File "/opt/odoo/odoo/openerp/__init__.py", line 72, in &lt;module&gt;
       import modules
     File "/opt/odoo/odoo/openerp/modules/__init__.py", line 27, in &lt;module&gt;
       from . import db, graph, loading, migration, module, registry
     File "/opt/odoo/odoo/openerp/modules/graph.py", line 32, in &lt;module&gt;
       import openerp.osv as osv
     File "/opt/odoo/odoo/openerp/osv/__init__.py", line 22, in &lt;module&gt;
       import osv
     File "/opt/odoo/odoo/openerp/osv/osv.py", line 23, in &lt;module&gt;
       from .orm import Model, TransientModel, AbstractModel
     File "/opt/odoo/odoo/openerp/osv/orm.py", line 5, in &lt;module&gt;
       from ..models import (
     File "/opt/odoo/odoo/openerp/models.py", line 2083
        groupby_dict = {gb['groupby']: gb for gb in annotated_groupbys}
  </code></pre>
  
  <p>This error clearly indicates that python 2.6 version is being run (dict comprehensions were introduced in 2.7). And anything I tried, let to same outcome, I either got different error or apache still runs version 2.6.</p>
  
  <p>My configuration:</p>
  
  <p>site config:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName some.eu
      ServerAlias *.some.eu
      WSGIDaemonProcess oe user=user group=some_group processes=2 python-path=/opt/odoo/odoo/ display-name=apache-odoo
      WSGIScriptAlias / /opt/odoo/openerp-wsgi.py
      WSGIProcessGroup oe
      ErrorLog /var/log/odoo/odoo-error.log
      CustomLog /var/log/odoo/odoo-access.log combined
      &lt;Directory /opt/odoo/odoo&gt;
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>My wsgi configuration file:</p>
  
  <pre><code>import sys
  import os
  import site
  #Activate virtualenv
  activate_this = os.path.expanduser("/opt/odoo/venv/bin/activate_this.py")
  execfile(activate_this, dict(__file__=activate_this))
  
  site.addsitedir('/opt/odoo/venv/lib/python2.7/site-packages/')
  sys.path.append("/opt/odoo/odoo")
  import openerp
  
  
  #----------------------------------------------------------
  # Common
  #----------------------------------------------------------
  openerp.multi_process = True # Nah!
  
  # Equivalent of --load command-line option
  openerp.conf.server_wide_modules = ['web']
  conf = openerp.tools.config
  
  # Path to the OpenERP Addons repository (comma-separated for
  # multiple locations)
  
  conf['addons_path'] = '/path/to/addons/'
  </code></pre>
  
  <p>Activating virtualenv in wsgi file seems to do nothing. If I change in apache site configuration <code>python-path</code> to <code>/opt/venv/lib/python2.7/site-packages/</code>, then I start getting different error saying that run time version is 2.6 and compiletime version is 2.7. Like this:</p>
  
  <pre><code>/opt/odoo/odoo/openerp/osv/orm.py:2: RuntimeWarning: compiletime version 2.7 of module 'lxml.etree' does not match runtime version 2.6
  </code></pre>
  
  <p>Does anyone have any solutions for this?</p>