473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unknown locale error for Malayalam language in Python

Dear friends,

I am a Python programmer from Kerala, India. When I tried to run a
simple python program which uses the Malayalam language (ml),

import os
import locale
os.environ['LANG']='ml'
print locale.getdefaultlocale()
It throws the following error :

Traceback (most recent call last):
File "test.py", line 4, in ?
print locale.getdefaultlocale()
File "/usr/local/lib/python2.4/locale.py", line 346, in
getdefaultlocale
return _parse_localename(localename)
File "/usr/local/lib/python2.4/locale.py", line 278, in
_parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: ml

Thanks in advance.

Maxin B. John
Feb 27 '08 #1
2 1663
-On [20080227 06:03], maxinbjohn (ma********@gmail.com) wrote:
>ValueError: unknown locale: ml
This is highly dependent on the operating system you are on. Last I remember
Debian, for example, required a locale package. FreeBSD already has all
locales installed, your mileage may vary.

Try ls /usr/share/locale and see if ml is even supported, you'd generally
have to use ml_IN I guess.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org/ asmodai
イェルーン ラウフãƒ*ック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/
Imitation is the sincerest form of flattery...
Feb 27 '08 #2

"maxinbjohn" <ma********@gmail.comwrote in message
news:86**********************************@u10g2000 prn.googlegroups.com...
| Dear friends,
|
| I am a Python programmer from Kerala, India. When I tried to run a
| simple python program which uses the Malayalam language (ml),
|
| import os
| import locale
| os.environ['LANG']='ml'
| print locale.getdefaultlocale()
|
|
| It throws the following error :
|
| Traceback (most recent call last):
| File "test.py", line 4, in ?
| print locale.getdefaultlocale()
| File "/usr/local/lib/python2.4/locale.py", line 346, in
| getdefaultlocale
| return _parse_localename(localename)
| File "/usr/local/lib/python2.4/locale.py", line 278, in
| _parse_localename
| raise ValueError, 'unknown locale: %s' % localename
| ValueError: unknown locale: ml
|
| Thanks in advance.

If you have a question, you should say what it is.
The error message seems clear to me.
The known locales depend on the OS and C compiler.

tjr

Feb 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ksenia Marasanova | last post by:
Hi, I have some problems with locale module. On my workstation, changing locale doesn't have effect: Python 2.3 (#1, Sep 13 2003, 00:49:11) on darwin Type "help", "copyright", "credits" or...
6
by: Stas Z | last post by:
Hello, Just noticed that the locale 'nb_NO' is not supported in Python?! stas@mobi:~$ locale LANG=nb_NO stas@mobi:~$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
3
by: robert | last post by:
Why can the default locale not be set by its true name? but only by '' ? : PythonWin 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32. (None, None) Traceback (most recent call last): File...
0
by: Tom Chilton | last post by:
Hi, I am running Gentoo Linux. I have emerge'd Bibus and everything seemed to go well. When I try to start it from a shell I get: tom@linuxbox ~ $ bibus Traceback (most recent call last):...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
2
by: Mario Ruggier | last post by:
On OS X 10.5.2 : $ python Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) on darwin Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last):...
5
by: ajaymohank | last post by:
Hello friends.... my problem is that i have 2 dropdown in which the second drop down will get filled based on the value selected in the first drop down. the values in both dropdown are displayed in...
0
by: Gabriel Genellina | last post by:
En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins <robert.rawlins@thinkbluemedia.co.ukescribi�: Probably you don't have support for 'de_DE' locale. Try using locale.setlocale(locale.LC_ALL,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.