Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

Hi,

It is an old topic, but just in case still helps someone that figured out yet…
If your context is the same as @ jiapei100 and mine, which is building your “own” python from cpython source code repository (forked). In my case for my C programs to run, I have setup this configuration:

export PYTHONHOME=/<path-to-your-local-repo>/cpython
export PYTHONPATH=/<path-to-your-local-repo>/cpython/Lib
1 Like