"Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'
If you set these two environment variables to nil, the problem should disappear:
set PYTHONHOME=
set PYTHONPATH=
To resolve the "Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi" error, you can try the following steps:
"Remove the PYTHONHOME environment variable. For you, it can be just that, or setting that variable to another value. This worked on Windows, and would work on Linux for sure. If someone tries this on Linux, please post a comment here!"
"Solve this problem by unsetting PYTHONHOME or PYTHONPATH, because they override the virtual environment variables.
In my case, this is caused by my admin's base environment. I would try removing PYTHONHOME and PYTHONPATH variables by doing:
unset PYTHONPATH
unset PYTHONHOME
"Press the Windows logo on the Toolbar.
Type and open 'Edit the system environment variables'.
In the Advanced tab, press the 'Environment Variables' button.
For System variables, press the 'New' button.
Variable name will be PYTHONHOME and Variable value will be the path where the python.exe is located (i.e. c:/users/administrator/anaconda3/envs/my_env_name). Then press OK.
Again, for System variables, press the 'New' button.
Variable name will be PYTHONPATH and Variable value will be the path of the site-packages folder (i.e. C:/Users/Administrator/anaconda3/envs/my_env_name/Lib/site-packages). Then press OK."