It is suggested to use PYTHONPATH. Mostly it is not needed and causes many things to break like this by making one Python load things form another Python.
Reason:
When you try to execute the command in python 3.5. Then the error message can occur;
Fatal Python error: Py_Initialize: Unable to get the locale encoding
InmportError: No module named ‘encodings’
Current thread 0x00007ff41bf46700 (most recent call first):
Aborted (core dumped)
What could be the problem?
How to fix- Fatal Python error: Py_Initialize: Unable to get the locale encodings
ImportError: No module named ‘encodings’
Solution:
This error can be due to multiple installations on your machine and the command python3.5 might be referring to libraries that belong to different versions of Python. There can be another reason “The command python3.5 is not able to find the PYTHON installation path.
Use the below lines to solve the error:
export PYTHONPATH = /usr/local/lib/python3.5
export PYTHONPATH = /usr/local/lib/python3.5
Note:
Make sure that you have set the correct installation path of Python3.5.
Python 3.5.9 (default, Nov 6 2015, 16:57;04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11) on Linux
Type “help”, “copyright”, “credits”, or “license” for more information.
>>>