When trying to install modules in Python 3.5, I receive an error saying that Python can't load the file system codec and the shell then freezes.
This is the same, or very similar, problem as here:
Py_Initialize fails - unable to load the file system codec
with a few notable exceptions. Most importantly, the solution from that Question won't work for me, because Python 2.7 is the production version on this server and therefore Python 3.5 can't be safely added to the environment variables.
The other differences are that the OS is Windows Server 2008 and that I'm trying to run Python directly in the command prompt shell, not via Visual Studio.
I am able to run Python 3.5 fine from within the Eclipse IDE, however I need to install some whl files (modules) which I believe must take place on the command line.
If I try to run Python on the command line at all, then it crashes with this error:
Fatal Python error: Py_Initialize: unable to load the file system codec
File "E:\Python27\lib\encodings\__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Current thread 0x00006a2c (most recent call first):
I note that the error message references Python 2.7 even though I'm in the Python35
directory and am trying to use Python 3.5
Typing pip3
causes the same error message above and causes Python to crash.