Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
98 views
in Technique[技术] by (71.8m points)

python - IPython Notebook locale error


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I summarize here the solution to be found on: http://blog.lobraun.de/2009/04/11/mercurial-on-mac-os-x-valueerror-unknown-locale-utf-8/

I added these lines to my .bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

I reloaded the profile:

source ~/.bash_profile

I then ran ipython again:

ipython notebook

Changing locales

The above will work for the English language in a US locale. One may want different settings.

At the risk of stating the obvious, to discover the current settings for your system, use:

$ locale

And to retrieve a list of all valid settings on your system:

$ locale -a

Then choose your preferred locale. For example, for a Swiss French locale, the solution would look like this:

export LC_ALL=fr_CH.UTF-8
export LANG=fr_CH.UTF-8

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...