So I’m running debian 10, and using python 3.7 (which I built from source). For some reason I can no longer use the CLI interpreter, and whenever I try to execute anything that relies on Python, it returns the following error:
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f41b0784740 (most recent call first):
Aborted
However, when I run the exact same command (either for the interpreter or when running a different python application) using sudo
, it works perfectly fine. It feels like the supporting python 3.7 modules are not accessible by the current user. But I’m not sure how to proceed in order to fix it.
2
Answers
Okay, so I found a way around this. I updated my python alias to point to
python3.7
instead ofpython3
. I am still, however, not sure if this is a solution, or a workaround. But it works now.You need to setup locale
For standard UTF-8 en_US you can do: