Odoo Help

Welcome!

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.

0

Want to run odoo on eclipse

By
Arjun Khode
on 12/20/14, 9:39 AM 1,879 views

I'm new to odoo. I'm trying to develop custom modules in Odoo on ubuntu 14 in eclpse using pydev.

I was able to run Odoo normally successfully by this command through the terminal: "cd /opt/odoo/odoo" and then "./openerp-server". I could use Odoo on localhost:8069 on my browser

However, I'm stuck with configuration for the development environment. The problem is whenever I try to 'python run' the file 'openerp-server' in eclipse, this is my console output:

 

"Traceback (most recent call last):
  File "/home/prashant/workspace/odoo/openerp-server", line 2, in <module>
    import openerp
  File "/home/prashant/workspace/odoo/openerp/__init__.py", line 72, in <module>
    import modules
  File "/home/prashant/workspace/odoo/openerp/modules/__init__.py", line 27, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/home/prashant/workspace/odoo/openerp/modules/db.py", line 23, in <module>
    import openerp.modules
  File "/home/prashant/workspace/odoo/openerp/modules/__init__.py", line 27, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/home/prashant/workspace/odoo/openerp/modules/graph.py", line 32, in <module>
    import openerp.osv as osv
  File "/home/prashant/workspace/odoo/openerp/osv/__init__.py", line 22, in <module>
    import osv
  File "/home/prashant/workspace/odoo/openerp/osv/__init__.py", line 23, in <module>
    import fields
  File "/home/prashant/workspace/odoo/openerp/fields.py", line 32, in <module>
    from openerp.tools import float_round, ustr, html_sanitize
  File "/home/prashant/workspace/odoo/openerp/tools/__init__.py", line 23, in <module>
    import win32
ImportError: No module named 'win32'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
    from urllib.request import urlopen
  File "/usr/lib/python3.4/urllib/request.py", line 88, in <module>
    import http.client
  File "/home/prashant/workspace/odoo/openerp/http.py", line 117
    except openerp.exceptions.DeferredException, e:
                                               ^
SyntaxError: invalid syntax

Original exception was:
Traceback (most recent call last):
  File "/home/prashant/workspace/odoo/openerp-server", line 2, in <module>
    import openerp
  File "/home/prashant/workspace/odoo/openerp/__init__.py", line 72, in <module>
    import modules
  File "/home/prashant/workspace/odoo/openerp/modules/__init__.py", line 27, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/home/prashant/workspace/odoo/openerp/modules/db.py", line 23, in <module>
    import openerp.modules
  File "/home/prashant/workspace/odoo/openerp/modules/__init__.py", line 27, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/home/prashant/workspace/odoo/openerp/modules/graph.py", line 32, in <module>
    import openerp.osv as osv
  File "/home/prashant/workspace/odoo/openerp/osv/__init__.py", line 22, in <module>
    import osv
  File "/home/prashant/workspace/odoo/openerp/osv/__init__.py", line 23, in <module>
    import fields
  File "/home/prashant/workspace/odoo/openerp/fields.py", line 32, in <module>
    from openerp.tools import float_round, ustr, html_sanitize
  File "/home/prashant/workspace/odoo/openerp/tools/__init__.py", line 23, in <module>
    import win32
ImportError: No module named 'win32'"

Can you please help me with this problem. Your help will be appreciated.

---------------------------------------------------------------------------------------------------------

Hi Michael, your answer was helpful and I was able to get across the win32 error by adding that location as a PYTHONPATH in eclipse. However, I am still stuck with many compile-time errors, most of them are errors on import statements in odoo/openerp/__init__.py like:

import conf

import tools

from . import models
from . import fields
from . import api
from openerp.tools.translate import _

Also, I am getting this error while 'Python-run'ing openerp-server :

  File "/home/prashant/workspace/odoo/openerp/tools/config.py", line 630
    os.chmod(self.rcfile, 0600)
                             ^
SyntaxError: invalid token

Can you please help and guide me with some tips to get odoo source code running through eclipse. I think I am missing out on some basic steps like adding some references. Thanks a lot for your help.

1
Michael Pol
On 12/20/14, 1:51 PM

There should be a python module(file) name win32.py which might be missing in your case, please check that file at /home/prashant/workspace/odoo/openerp/tools location.

If your root path is different pass configuration file(openerp-server.conf) as argument to interpreter.

0
Arjun Khode
On 12/21/14, 2:43 AM

Update: Problem solved. My python interpreter was not set up properly. It requires python 2.7 interpreter to run Odoo.

=================

Hi Michael, your answer was helpful and I was able to get across the win32 error by adding that location as a PYTHONPATH in eclipse. However, I am still stuck with many compile-time errors, most of them are errors on import statements in odoo/openerp/__init__.py like:

import conf

import tools

from . import models
from . import fields
from . import api
from openerp.tools.translate import _

Also, I am getting this error while 'Python-run'ing openerp-server :

  File "/home/prashant/workspace/odoo/openerp/tools/config.py", line 630
    os.chmod(self.rcfile, 0600)
                             ^
SyntaxError: invalid token

Can you please help and guide me with some tips to get odoo source code running through eclipse. I think I am missing out on some basic steps like adding some references. Thanks a lot for your help.

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

1 follower(s)

Stats

Asked: 12/20/14, 9:39 AM
Seen: 1879 times
Last updated: 3/16/15, 8:10 AM