Odd locale error that has disappeared on reboot.

Inada Naoki songofacandy at gmail.com
Wed Dec 8 21:56:04 EST 2021


On Wed, Dec 8, 2021 at 2:52 AM Chris Green <cl at isbd.net> wrote:
>
>
> At 03:40 last night it suddenly started throwing the following error every
> time it ran:-
>
>     Fatal Python error: initfsencoding: Unable to get the locale encoding
>     LookupError: unknown encoding: UTF-8
>
>     Current thread 0xb6f8db40 (most recent call first):
>     Aborted
>
> Running the program from the command line produced the same error.
> Restarting the Pi system has fixed the problem.
>

This error means Python can not find its standard libraries. There are
some possibilities.

* You set the wrong PYTHONHOME
  PYTHONHOME is very rarely useful. It shouldn't be used if you can
not solve this kind of problem.

* Your Python installation is broken.
  Some files are deleted or overwritten. You need to *clean* install
Python again.

Bets,
-- 
Inada Naoki  <songofacandy at gmail.com>


More information about the Python-list mailing list