I am very new to python, I have installed Python 3.6 on my Windows 10 machine ( and I believe it has version 2.7 installed ). The installation was ok but when I try to start up it gives me error as shown below
Fatal Python error: Py_Initialize: unable to load the file system codec
File "C:\csvn\Python25\\lib\encodings\__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Current thread 0x00002c78 (most recent call first):
Please someone would help me to identify this error and how to fix it. Thank you so much in advance for any help.
2 Answers 2
The error can be resolved by adding an environment variable "PYTHONPATH" which point to the installation location of Python.
Refer to the following link,
1 Comment
PYTHONHOME (which should only be set temporarily in particular embedding and non-standard distribution scenarios) or adding standard directories to PYTHONPATH. Don't compound a mistake with more mistakes.It may be because you have different versions of Python installed, so when you try to use the newest installed, it may be use the old interpreter instead, to solve the problem you absolutely need to change the PYTHONPATH.
encodingsin Python 3.6. That comma in theraisestatement that is causing the syntax error is valid in Python 2 but not in Python 3. You can even see the version number in the path mentioned in the message.PYTHONPATHnorPYTHONHOMEset in your environment. In a command prompt, enterset PYTHONto confirm that neither is set. If you usePYTHONPATHto add custom library directories, it should never include Python's installation directory or standard library directories.