Odoo Help


[Solved]How to solve "UnknownLocaleError: unknown locale 'en'"? [Closed]

on 4/4/13, 8:39 AM 8,946 views

The Question has been closed for reason: off-topic or not relevant

Nicolas Bessi
on 04/04/2013 09:58:43

Client Traceback (most recent call last): File "/var/packages/OpenERP6.1/target/openerp/addons/web/common/http.py", line 180, in dispatch response["result"] = method(controller, self, **self.params) File "/var/packages/OpenERP6.1/target/openerp/addons/web/controllers/main.py", line 316, in translations for x in po: File "/volume1/@appstore/Python/usr/lib/python2.7/site-packages/babel/messages/catalog.py", line 522, in __iter__ File "/volume1/@appstore/Python/usr/lib/python2.7/site-packages/babel/messages/catalog.py", line 302, in _get_mime_headers File "/volume1/@appstore/Python/usr/lib/python2.7/site-packages/babel/dates.py", line 501, in format_datetime File "/volume1/@appstore/Python/usr/lib/python2.7/site-packages/babel/core.py", line 212, in parse File "/volume1/@appstore/Python/usr/lib/python2.7/site-packages/babel/core.py", line 137, in __init__ UnknownLocaleError: unknown locale 'en'

This problem arised when I make a new install of python2.7 . How to solve this?

It seems to be a bug in local management, when en local is not present on system. Please report a bug on launchapd.

Camptocamp SA
on 4/4/13, 9:58 AM

@nbessi -- I really don't agree with closing this. Reporting a bug doesn't bring a broken site back to life. @Ton123, since I see you are on an Ubuntu system, may I recommend you try the command "sudo dpkg-reconfigure locales". Installing Python shouldn't screw up your locales, but I seem to remember something like that happening to me too. What do you see when you run the command "locale -a"?

on 4/4/13, 5:27 PM
on 4/4/13, 5:28 PM

Thank you Martin. It is an issue because is doesn't work. But it is not a disaster because it is started after I made a restore on my testsystem, it is only on my testsystem. So don't bother about closing the question. The problem is if i do not have a working copy of my production server I doesn't want to make changes to this. So I can't go on with new things. I work production and test not on Ubuntu but with packages on Synology. I do have a Ubuntu system for reference. The commands you suggest are not familiar for me but I manage but on Synology it can be a little bit different.

on 4/4/13, 6:16 PM

@nbessi. As far as I can see bug reporting for a non programmer is not very easy. I do not understand what you want to say with: "when en local is not present on system". I have not a buildnumber of my installation so I can't test it with runbot. Of course it can be a bug. But I think it has something todo with installed python code. And an other thing is there could be a workaround that can be found via a discussion.

on 4/4/13, 6:23 PM

Solved without installing new software. I did several things but I think the following made the difference: I made a new fresh database. In languagues EN US is default. I installed extra languages EN UK and Dutch / Nederlands. I closed this new database and I started the restored database. And the error message was gone.

on 4/9/13, 5:25 AM

Yes, that make sense. You forced OpenERP to go get the ´en´ local and put it in the right place.

on 4/9/13, 8:39 AM

Olivier Dony (odo)

--Olivier Dony (odo)--

| 7 6 7
--Olivier Dony (odo)--


Olivier Dony (odo)
On 7/25/14, 8:02 AM

For the record, if you're experiencing this on Ubuntu 14.04 (after dist-upgrading) chances are you're being hit by this bug, which is related to this upstream bug. Until this is properly fixed the workaround is to force the reinstallation of the package:

    sudo apt-get install --reinstall python-babel-localedata 

This should be simpler and cleaner than copying around the low-level data files that have been incorrectly deleted.

On 6/25/14, 6:41 AM

Thanks to Pedro comment, I have solved it making:

ln -s /usr/share/python-babel-localedata/localedata/en_150.dat /usr/share/python-babel-localedata/localedata/en.dat

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/4/13, 8:39 AM
Seen: 8946 times
Last updated: 3/16/15, 8:10 AM