Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


OpenERP 8 + mod_wsgi + No module named openerp : addon path issue?

Mind And Go
on 5/26/14, 6:26 PM 4,047 views

Hy everyone,

I followed some excellent resources here:

  1. https://doc.openerp.com/trunk/server/deployment-mod-wsgi/
  2. https://www.odoo.com/forum/Help-1/question/How-to-install-OpenERP-8-using-mod_wsgi-44186

I'm working with the latest trunk and thanks to this I configured an apache virtual host :

<VirtualHost *:80>
        ServerName openerp.local

        WSGIScriptAlias / /home/openerp/odoo/openerp-wsgi.py
        WSGIDaemonProcess oe user=openerp group=openerp processes=4 python-path=/home/openerp/odoo display-name=apache-openerp
        WSGIProcessGroup oe

        <Directory /home/openerp/odoo/ >
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all

Apache restart gracefully without any issue. Unfortunately when I try to reach the http://openerp.local and whatever I set in the conf['addons_path'] I still having this issue :

[Tue May 27 00:14:03 2014] [error] [client] mod_wsgi (pid=3001): Exception occurred processing WSGI script '/home/openerp/odoo/openerp-wsgi.py'.
[Tue May 27 00:14:03 2014] [error] Traceback (most recent call last):
[Tue May 27 00:14:03 2014] [error]   File "/home/openerp/odoo/openerp-wsgi.py", line 15, in <module>
[Tue May 27 00:14:03 2014] [error]     import openerp
[Tue May 27 00:14:03 2014] [error] ImportError: No module named openerp

Here are my tests :

  1. conf['addons_path'] = '../../addons/trunk,../../web/trunk/addons'  => FAILED
  2. conf['addons_path'] = '/home/openerp/odoo/addons,/home/openerp/odoo/openerp/addons' => FAILED
  3. conf['addons_path'] = '../odoo/addons' or conf['addons_path'] = '../../addons' or conf['addons_path'] = '../addons' neither work

Any advice would be appreciated,


Run your server normally as you run in localhost, just use apache2 reverseproxy, make easy this job.

on 5/26/14, 11:17 PM

Can you give some reasons why using wsgi is superior to reverseproxy? I have also been successful with the latter, so it would be interesting to know what further benefits wsgi would provide.

on 5/27/14, 4:32 AM

I think I have the clue, I'll try it later caus' I don't have access to the server. Anyway, I already succeed in setting a reverse proxy which is most of time efficient but it suppose to maintian 2 services one for apache and the other for openerp thanks. Thanks to wsgi, it could be considered a simple web site in a virtual host. Retsarting apache will simply restart the OpenERP.Much more easier for an admin sys regarding to me.

Mind & Go, Mind And Go
on 5/27/14, 5:21 AM

So you see just one advantage: restarting Apache will also restart Odoo? It hardly seems worth the extra effort.

on 5/27/14, 5:46 AM

Well, it's not such an effort, in the past I also struggle with reverse proxy and additionnal parameters, proxy conf in OpenERP, etc... and moreover, reading wsgi Doc and other examples really helps to understand everything. I'll post my tests tonight and you'll see that is not so hard as reverse proxy. Moreover, I already work with stuff like passenger fusion for ruby on rails and it's much easier too deal with as with reverse proxy

Mind & Go, Mind And Go
on 5/27/14, 5:51 AM

I'm looking forward to seeing how it is done. What WSGI doc do you recommend?

on 5/27/14, 5:52 AM

Well, I wrote too fast, I tried to adapt the virtual host without success. So I still stucked. I'll let you know

Mind & Go, Mind And Go
on 5/27/14, 11:00 AM

so, the problem doesnt seems to come from this part of the conf. I run mutiple python version and my mod_wsgi probably don't use the correct one. I'll let you know when it's OK

Mind & Go, Mind And Go
on 5/27/14, 3:01 PM
Mind And Go
On 5/27/14, 3:48 PM

Ok, here is the part of the answer :

  1. running on centos 6.5 I didn't have python 2.7
  2. I installed the python 2.7 with SCL : http://wiki.centos.org/AdditionalResources/Repositories/SCL
  3. Then I have to recompile mod_wsgi for python 2.7 thanks to this http://www.fir3net.com/Redhat-/-Fedora/how-do-i-compile-modwgsi-for-python-27.html

Now, I have another expressive error :
[error] No handlers could be found for logger "openerp.addons.website_event.controllers.main"
[Tue May 27 19:33:37 2014] [error] [client] mod_wsgi (pid=19271): Exception occurred processing WSGI script '/home/openerp/odoo/openerp-wsgi.py'.
[Tue May 27 19:33:37 2014] [error] [client] Traceback (most recent call last):
[Tue May 27 19:33:37 2014] [error] [client]   File "/home/openerp/odoo/openerp/service/wsgi_server.py", line 215, in application

Show must go on, let's find the clue!


let's have a walk on the git side : https://github.com/odoo/odoo/issues/242

Mind & Go, Mind And Go
on 5/27/14, 4:59 PM

This post is answered. The other problem is either a bug or need another post later on

Mind & Go, Mind And Go
on 5/28/14, 3:37 AM

Very strange, I succeed to make wsgy works on 7.0 but not on nightly build

Mind & Go, Mind And Go
on 5/29/14, 6:34 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)


Asked: 5/26/14, 6:26 PM
Seen: 4047 times
Last updated: 3/16/15, 8:10 AM