Can't launch trunk version of the web client, ImportError: No module named _cpconfig

Asked by Franck BRET

With trunk version can't launch Etiny, raise an error about cherryp _cpconfig

franck@franck-laptop:~/workspace/src/trunk/openobject/client-web$ ./start-openerp-web.py
Traceback (most recent call last):
  File "./start-openerp-web.py", line 11, in <module>
    from openerp.commands import start, ConfigurationError
  File "/home/franck/workspace/src/trunk/openobject/client-web/openerp/commands.py", line 11, in <module>
    from cherrypy._cpconfig import as_dict
ImportError: No module named _cpconfig

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Solved by:
Amit Mendapara
Solved:
Last query:
Last reply:
Revision history for this message
Best Amit Mendapara (cristatus) said :
#1

We have migrated trunk version to CherryPy3 and dropped TurboGears. Now web client uses faster Mako templates and Babel for l18n. I'll write to the community about the changes soon.

As CherrpyPy3 conflicts with CherryPy2, we have added support for local lib directory where you can install all the dependencies without spoiling your system python installation. Just cd to lib dir and run `populates.sh` it will download and install required libraries. Now just launch the web client...

We'll update docs soon...

Revision history for this message
Franck BRET (franckbret) said :
#2

Ok
Many thank's, populate.sh just run fine in my case and finally etiny runs.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) said :
#3

I think we should add some kind of "try" before the real import, so a descriptive error message is displayed if the libs dir hasn't been populated yet.

Maybe something like

try:
     from cherrypy._cpconfig import as_dict
except ImportError:
     raise Exception("You haven't populated your libs dir, have you? (https://answers.launchpad.net/openobject-client-web/+question/68357)")

Revision history for this message
Amit Mendapara (cristatus) said :
#4

Better to check CherryPy version instead as system installation should not use private `lib` directory...

Revision history for this message
Yannick Warnier (ywarnier) said :
#5

sudo apt-get install python-mako python-babel python-cherrypy3 still triggers the error:

...
    from babel import dates
ImportError: No module named babel

Any clue?

Revision history for this message
fonji (fonji) said :
#6

@Yannick: got the same problem on Debian lenny.
The problem was that my python-pybabel was too old (before Babel >= 0.9.4 as needed).

I got the right one from the Debian testing packages.
http://packages.debian.org/squeeze/python-pybabel

Hope this helps.

Revision history for this message
Yannick Warnier (ywarnier) said :
#7

Sorry for the lack of personal feedback on this. I reported the error personally to Fabien Pinckaers in the last partners meeting in Belgium and he pointed me on the fact that there is a script: web/lib/populate.sh, that actually completes the installation and fixes this problem. Effectively, that fixed it.

I suppose the script in itself calls a more recent version of pybabel or something like that...

Thanks @fonji

Revision history for this message
David Fraser (davidf) said :
#8

Note that CherryPy 3.2.0rc1 doesn't include as_dict in _cpconfig
I had a locally installed cherrypy from svn. I got around this by setting CherryPy == 3.1.2 (instead of >= 3.1.2) in the EGG-INFO/requires.txt so that the system version was chosen

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) said :
#9

David, creating a bug entry for that might be a better idea, though since Cherrypy 3.2 has yet to be released it'd be a fairly low priority one trying to find out how to drop as_dict (and use something else) might be a good idea.