I'm trying to run Odoo in a virtualenv. I've done this for other Python apps so I followed the same recipe.
My openerp-wsgi.py looks like:
import os
import sys
import site
sys.path.insert(0,'/home/futuracode/projects/odoo/')
sys.path.insert(1,'/home/futuracode/.virtualenvs/odoo/lib/python2.7/site-packages')
site.addsitedir('/home/futuracode/.virtualenvs/odoo/lib/python2.7/site-packages')
activate_this = os.path.expanduser("~/.virtualenvs/odoo/bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))
project="/home/futuracode/projects/odoo"
workspace=os.path.dirname(project)
sys.path.append(workspace)
import openerp
openerp.multi_process = True # Nah!
openerp.conf.server_wide_modules = ['web']
conf = openerp.tools.config
conf['addons_path'] = '/home/futuracode/projects/odoo/addons,/home/futuracode/projects/odoo/openerp/addons'
conf['db_name'] = 'BLAH'
conf['database'] = 'BLAH'
conf['db_host'] = 'localhost'
conf['db_user'] = 'USERBLAH'
conf['db_port'] = PORTNUMBER
conf['db_password'] = 'SECRET'
conf['logfile'] = '/home/futuracode/projects/logs/odoo_gestao.log'
application = openerp.service.wsgi_server.application
openerp.service.server.load_server_wide_modules()
bind = '127.0.0.1:8069'
pidfile = '.gunicorn.pid'
workers = 4
timeout = 240
max_requests = 2000
When I try to access the application, I see this in the logs:
Wed Dec 03 10:22:24 2014] [error] [client 127.0.0.1] from dateutil.relativedelta import relativedelta
[Wed Dec 03 10:22:24 2014] [error] [client 127.0.0.1] ImportError: cannot import name relativedelta
I've googled a little bit and couldn't find any solution that applies to this specific problem since most of them are related to wrong python version (2.6 instead of 2.7), wrong python-dateutil version, or wrong PYTHONPATH.
My configs are:
[Wed Dec 03 10:09:57 2014] [notice] Apache/2.2.25 (Unix) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
$ pip freeze | grep dateutil
python-dateutil==1.5
Any help on this? Thanks in advance.