This forum is now just an archive. Use the new Q&A website
It is currently Thu Apr 24, 2014 8:48 am

All times are UTC + 2 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: ImportError: cannot import name as_dict [SOLVED]
PostPosted: Sat Feb 26, 2011 11:37 pm 
Offline

Joined: Sat Dec 19, 2009 11:26 am
Posts: 6
Hello,

I have installed PostgreSQL 8.3 (8.3.14-0lenny1) and OpenERP Server 5.0.15 without problems in a OpenVZ virtual machine with Debian Lenny 5.0 (Linux 2.6.24-10-pve). And I have installed GTK client v5.0.6 in a laptop with Ubuntu 10.04. These three applications work and connect properly.

But I can't install the Web client 5.0.6 in the OpenVZ Debian Lenny. I have tried it in three ways: Bazaar, easy_install and wget. But I always get the same error:

$ python2.5 openerp-web.py
Traceback (most recent call last):
File "openerp-web.py", line 11, in <module>
from openerp.commands import start, ConfigurationError
File "/home/rsync/openerp/stable/5.0/openerp-web-5.0.7/openerp/commands.py", line 11, in <module>
from cherrypy._cpconfig import as_dict
ImportError: cannot import name as_dict

I have tried with cherrypy and cherrypy3:

# apt-cache policy python-cherrypy
python-cherrypy:
Installed: 2.3.0-1
Candidate: 2.3.0-1
...

# apt-cache policy python-cherrypy3
python-cherrypy3:
Installed: 3.0.2-2
Candidate: 3.0.2-2
...

Any idea?

Thanks,

Manuel


Last edited by spanish on Mon Feb 28, 2011 10:11 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict (Debian Lenny Op
PostPosted: Sun Feb 27, 2011 1:26 am 
Offline

Joined: Thu Jun 30, 2005 1:53 am
Posts: 22
Location: Harvard, MA USA
Same problem with openerp-web-6.0.1 install

We need help, or at least a suggestion. There is no 'as_dict' in the referenced module 'cherrypy._cpconfig'

_________________
Cy Radford
Systems Plus, Inc.


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict (Debian Lenny Op
PostPosted: Sun Feb 27, 2011 5:20 am 
Offline

Joined: Fri Feb 18, 2011 9:21 pm
Posts: 11
Not sure if this will help the OP, but my workaround was:

http://www.openerp.com/forum/post76200.html#p76200


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict (Debian Lenny Op
PostPosted: Sun Feb 27, 2011 3:19 pm 
Offline

Joined: Sat Dec 19, 2009 11:26 am
Posts: 6
mtwebster wrote:
Not sure if this will help the OP, but my workaround was:
http://www.openerp.com/forum/post76200.html#p76200

Thanks,

I have changed "CherryPy >= 3.1.2" to "CherryPy == 3.1.2" in setup.py and populate.sh in a new bzr download of Web Client 5.0.6.

Currently, my CherryPy version is 3.1.2 in lib folder:
Code:
$ vi lib/cherrypy/__init__.py
...
__version__ = "3.1.2"
...

I have installed Web Client with Easy_Install in Python 2.5 and Python 2.6:
Code:
# easy_install-2.5 -U openerp-web
Searching for openerp-web
Reading http://pypi.python.org/simple/openerp-web/
Reading http://openerp.com/
Reading http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28
Best match: openerp-web 5.0.6
Processing openerp_web-5.0.6-py2.5.egg
openerp-web 5.0.6 is already the active version in easy-install.pth
Installing openerp-web script to /usr/bin

Using /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg
Processing dependencies for openerp-web
Finished processing dependencies for openerp-web

# easy_install -U openerp-web
Searching for openerp-web
Reading http://pypi.python.org/simple/openerp-web/
Reading http://openerp.com/
Reading http://www.openerp.com/index.php?option=com_content&view=article&id=18&Itemid=28
Best match: openerp-web 5.0.6
Processing openerp_web-5.0.6-py2.6.egg
openerp-web 5.0.6 is already the active version in easy-install.pth
Installing openerp-web script to /usr/local/bin

Using /usr/local/lib/python2.6/site-packages/openerp_web-5.0.6-py2.6.egg
Processing dependencies for openerp-web
Finished processing dependencies for openerp-web

But I have the same problem,
both with Python 2.5:
Code:
$ openerp-web
Traceback (most recent call last):
  File "/usr/bin/openerp-web", line 8, in <module>
    load_entry_point('openerp-web==5.0.6', 'console_scripts', 'openerp-web')()
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 277, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2179, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1912, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg/openerp/commands.py", line 11, in <module>
    from cherrypy._cpconfig import as_dict
ImportError: cannot import name as_dict

as with Python 2.6:
Code:
$ openerp-web
Traceback (most recent call last):
  File "/usr/local/bin/openerp-web", line 8, in <module>
    load_entry_point('openerp-web==5.0.6', 'console_scripts', 'openerp-web')()
  File "/usr/local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 318, in load_entry_point
  File "/usr/local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2221, in load_entry_point
  File "/usr/local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1954, in load
  File "/usr/local/lib/python2.6/site-packages/openerp_web-5.0.6-py2.6.egg/openerp/commands.py", line 11, in <module>
    from cherrypy._cpconfig import as_dict
ImportError: cannot import name as_dict

Any idea?

Thanks,

Manuel


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict (Debian Lenny Op
PostPosted: Sun Feb 27, 2011 9:07 pm 
Offline

Joined: Thu Jun 30, 2005 1:53 am
Posts: 22
Location: Harvard, MA USA
My problem was that the default version of cherrypy was 3.2.0 and the web-server seems to have needed 3.1.2.

I used 'easy_install -m cherrypy' to remove the dependants and then went to the 'dist-packages' directory to remove the egg (/usr/local/lib/python2.6/dist-packages on Ubuntu 10.04).

After that I used 'easy_install cherrypy==3.1.2' to install the required version and now the web-server starts.

Cheers!

_________________
Cy Radford
Systems Plus, Inc.


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict (Debian Lenny Op
PostPosted: Mon Feb 28, 2011 10:09 pm 
Offline

Joined: Sat Dec 19, 2009 11:26 am
Posts: 6
Thank you very much!

\ ;-D

Your info helped me. The problem was Easy Install in Python 2.5 installs CherryPy 3.2.0:
Code:
# easy_install-2.5 -U openerp-web
...
Installed /usr/lib/python2.5/site-packages/openerp_web-5.0.6-py2.5.egg
Processing dependencies for openerp-web
Searching for CherryPy>=3.1.2
...
Best match: CherryPy 3.2.0
...
Installed /usr/lib/python2.5/site-packages/CherryPy-3.2.0-py2.5.egg
Finished processing dependencies for openerp-web

So after install OpenERP Web Client 5.0.6 I can solve the problem uninstalling CherryPy 3.2.0 and installing CherryPy 3.1.2.

All is working now in Debian Lenny.

\ ;-)

Thanks,

Manuel


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict [SOLVED]
PostPosted: Tue Mar 08, 2011 4:07 am 
Offline

Joined: Tue Mar 08, 2011 4:04 am
Posts: 1
Thanks, I had the exact same problem and it was actually the cherrypy version that needed to be downgraded to 3.1.2


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict [SOLVED]
PostPosted: Sun May 01, 2011 6:31 pm 
Offline

Joined: Wed Dec 15, 2010 8:14 pm
Posts: 693
Thanks a lot for this information. I just updated my server to Ubuntu 11.04 and the web client crashed, due to problems with not having CherryPy installed. First I installed the package with

easy_install cherrypy

to no avail, it still kept crashing. I removed it and installed the 3.1.2 version and then it worked.

Just wanted to post this since this might happen to the people moving their computers to Ubuntu 11.04

Cheers,

_________________
Gustavo Orrillo
http://business.moldeo.coop/blogs


Top
 Profile  
 
 Post subject: Re: ImportError: cannot import name as_dict [SOLVED]
PostPosted: Thu May 05, 2011 1:09 pm 
Offline

Joined: Mon Jan 10, 2011 9:14 am
Posts: 121
As far as I know this is solved with OpenERP VERSION 6.0.2.

_________________
Ubuntu server 10.04 LTS (64 bit)
OpenERP v.6.0.2 with openerp-web client


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP