This question has been flagged
2 Replies
5533 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.

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author Best Answer

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.

Avatar
Discard