[Linux]yum 报错 ModuleNotFoundError: No module named ‘encodings‘

yum 报错
ModuleNotFoundError: No module named ‘encodings’

Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f9959996f40 (most recent call first):
Aborted (core dumped)

[Linux]yum 报错 ModuleNotFoundError: No module named ‘encodings‘_第1张图片
原因:误删了centos8环境自带python3.6,重新拷贝以下文件即可

(因为我是用的centos镜像,所以直接拉取一遍镜像先拷贝到宿主机,再拷贝到发生问题的容器即可)。

发生问题时的whereis python

#> whereis python  
python: /usr/bin/python /usr/bin/python3.8 /usr/lib/python3.8 /usr/lib64/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8 /usr/share/man/man1/python.1.gz

问题解决后时的whereis python

#> whereis python
python: /usr/bin/python /usr/bin/python3.8 /usr/lib/python3.6 /usr/lib/python3.8 /usr/lib64/python3.6 /usr/lib64/python3.8 /usr/local/lib/python3.8 /usr/include/python3.6m /usr/include/python3.8 /usr/share/man/man1/python.1.gz

你可能感兴趣的:(日常学习)