ExitCodeException exitCode=134: Fatal Python error: Py_Initialize: Unable to get the locale encoding
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 593
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 6
Description
### Steps to reproduce
Hello, I am getting following error while using Jupyter notebook:
```
Install jupyter and launch notebook:
-hdp ~]$ /opt/anaconda3/bin/jupyter notebook
.......
[I 11:40:05.457 NotebookApp] The Jupyter Notebook is running at: http://usdfwxx.com:8888/
..........
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007f55e7053740 (most recent call first):
ls: cannot access /usr/hdp//hadoop/lib: No such file or directory
......
ExitCodeException exitCode=134: Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007f45a6104740 (most recent call first):
```
I already tried following but didn't help:
1. exporting environment variables in my user's bash profile.
2. tried updating Py4j version to py4j-0.10.9-src.zip in '/usr/hdp/current/spark2-client//python/lib'
3. updating python version to 3.6 and then 3.7 and pointing '/opt/anaconda3/bin/python3 -> /usr/local/bin/python3.7'
and /opt/anaconda3/bin/python3 -> python3.5
4. pip install findspark
pip install statsd
python3 -m pip install pyspark
Need your expert advise on this now.
### Expected behavior
There should not be any error
### Actual behavior
Attached screenshot:


### Environment
-hdp ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)
Contributor guide
Assessment
This issue has not been assessed yet.