error in Import rpc in trunk version 4638

Bug #756723 reported by Cuong
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Opinion
Undecided
Unassigned

Bug Description

Hi,

I've just installed the latest trunk version (build 4638) of openerp-client-web. Then I run it. An import error occurs in file
 for module rpc (line 14: from openobject import errors, paths, rpc)

/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/addons.py

Thanks.

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello Cuong,

I have tested this issue with rev no: 4640 and did not face such a problem.
So, Would you please check it with updated code and notify us.

Thanks.

Changed in openobject-client-web:
status: New → Incomplete
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

You probably have old, downloaded web addons in you addons/ folder (pad, share or wiki, most of the time). Some modules moved around between 6.0 and trunk, and not all addons were version-bumped, so they're still looking for the old module because they were not automatically overwritten.

Remove the non-versioned addons, it should fix the issue.

Changed in openobject-client-web:
status: Incomplete → Invalid
Revision history for this message
Cuong (bhcuong2008) wrote :

Hi,

Today I've tried trunk version and got the same error in importing rpc.
Here is the error message when running this script, /usr/local/bin/openerp-web
===================================================
Traceback (most recent call last):
  File "/usr/local/bin/openerp-web", line 5, in <module>
    pkg_resources.run_script('openerp-web==6.1-dev', 'openerp-web')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/EGG-INFO/scripts/openerp-web", line 4, in <module>
    from openobject.commands import start, ConfigurationError
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/__init__.py", line 16, in <module>
    import openobject.widgets
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/widgets/__init__.py", line 1, in <module>
    from _base import *
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/widgets/_base.py", line 9, in <module>
    from openobject import tools
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/tools/__init__.py", line 1, in <module>
    from _tools import *
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/tools/_tools.py", line 35, in <module>
    import openobject.addons
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openobject/addons.py", line 14, in <module>
    from openobject import errors, paths, rpc
ImportError: cannot import name rpc
============================================

Regards,

Revision history for this message
dambsst (dambsst) wrote :

Hello,

Same thing for me, the rpc folder is present but not in the build: /opt/openerp-web/build/lib.linux-x86-64-2-6.

When I manually copy it into /usr/..., it finds it but it gives the same error for another import:
"
File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/EGG-INFO/scripts/openerp-web", line 4, in <module>
    from openobject.commands import start, ConfigurationError
ImportError: cannot import name ConfigurationError
"

I supposed it comes from my distrib, what should I remove to get a new clean installation of openerp-client-web? (because I was upgrading a previous 6.0.1)

Thanks,

Revision history for this message
dambsst (dambsst) wrote :

Hello again,

Everything works fine now, but I had to do some little things certainly due my previous installation (on ubuntu 10.04):

1. copy all files from /opt/openerp-web/openobject -->/usr/local/lib/python2.6/dist-packages$ sudo gedit openerp_web-6.1_dev-py2.6.egg/openerobject/

2. modify the file /usr/local/lib/python2.6/dist-packages$ sudo gedit openerp_web-6.1_dev-py2.6.egg/EGG-INFO/scripts/openerp-web:

#!/usr/bin/python
import sys

from openobject.commands import start#, ConfigurationError

if __name__ == "__main__":
    try:
        start()
    except:# ConfigurationError, exc:
        sys.stderr.write(str(exc)+"\n")
        sys.exit(1)

3. copy the file /opt/openerp-web/openerp-web.cfg to /etc/ (as always but very important here)

4. I hvae also remove and reinstall http://pypi.python.org/pypi/distribute

It is working fine for me now.

Regards,

Revision history for this message
dambsst (dambsst) wrote :

1. copy all files from /opt/openerp-web/openobject -->/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/openerobject/

2. modify the file /usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/EGG-INFO/scripts/openerp-web:
...

Sorry I should re-read my text before I post, but I won't correct the grammar anyway ;)

Changed in openobject-client-web:
status: Invalid → Opinion
Revision history for this message
Robin Panis (panisrobin-telenet) wrote :

hi,

when i follow your workaround i get

Traceback (most recent call last):
  File "/usr/local/bin/openerp-web", line 5, in <module>
    pkg_resources.run_script('openerp-web==6.1-dev', 'openerp-web')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/openerp_web-6.1_dev-py2.6.egg/EGG-INFO/scripts/openerp-web", line 10, in <module>
    sys.stderr.write(str(exc)+"\n")
NameError: name 'exc' is not defined

can you advise how to correct this ?

Revision history for this message
Damien Raemy (damien.raemy) wrote :

Hello,

Your error is normal. When you followed the dambsst's procedure, your removed the error because ConfigurationError is not found, but, if there is an error during the start() method, this error occured, because you commented the exc variable assignement.

In my opinion, comment this lines remove the error, but is very unclean, because if there is an error, the script make another error. The best way would be to reinstall openobject.commands.ConfigurationError.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.