Pelican 3.3 Pelican-Quickstart Error "Valueerror: Unknown Locale: Utf-8"

Pelican 3.3 pelican-quickstart error ValueError: unknown locale: UTF-8

You could try a solution posted here or here. Basically, add some lines to your ~/.bash_profile:

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

There is an outstanding bug report related to this issue. It appears that Python makes some assumptions about the format of locale names that aren't universally valid. Explicitly setting these environment vars is basically just a workaround for that bug.

[Edit:] As @asmeurer correctly points out, the above fix assumes English and the U.S. You should really pick your preferred locale from the list given by locale -a (generally one that ends in UTF-8).

Plone not starting ValueError: unknown locale: UTF-8

http://plone-training.readthedocs.org/en/latest/plone_training_config/instructions.html recommends the following for your error (it's for OSX & Vagrant, but I guess you might as well try it even if you've got a different setup):

In that case you have to [set] the localized keyboard and language
settings in the .bash_profile of the vagrant user to your locale (e.g. en_US.UTF-8 or de_DE.UTF-8)

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

ValueError: unknown locale: UTF-8 when importing pandas in python 2.7

Looks like you're on OS X. Append this to your ~/.bash_profile:

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

And then run:

$ source ~/.bash_profile

Now try import pandas.

Error 'unknown locale: UTF-8' on 'pandas' import (Mac OS X) when running fish shell

for fish shell

set -x LC_ALL en_US.UTF-8 
set -x LANG en_US.UTF-8

Pandas importation fails on ipython and Jupyter

I found the solution: the error comes from a value error due to an encoding problem.

It happens quite a lot in python and various questions have been asked about it. Among them, the following link explains it carefully:

Pelican 3.3 pelican-quickstart error "ValueError: unknown locale: UTF-8"

To be short, one only needs to run the following bash code to solve the problem:

echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.bashrc && source ~/.bashrc

matplotlib does not import in python3

Found a solution here. Basically what you have to do is add two lines to your ~/.bash_profile (and re-open terminal window):

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


Related Topics



Leave a reply



Submit