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

I had the same error and I was able to solve it in the following way: django - init_fs_encoding: failed to get the Python codec of the filesystem encoding - Stack Overflow