Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00008bd8 (most recent call first):
<no Python frame>
完整信息如下:
Python path configuration:
PYTHONHOME = 'C:\PythonHome'
PYTHONPATH = 'C:\PythonPath'
program name = 'D:\Python38\python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'D:\\Python38\\python.exe'
sys.base_prefix = 'C:\\PythonHome'
sys.base_exec_prefix = 'C:\\PythonHome'
sys.executable = 'D:\\Python38\\python.exe'
sys.prefix = 'C:\\PythonHome'
sys.exec_prefix = 'C:\\PythonHome'
sys.path = [
'C:\\PythonPath',
'D:\\Python38\\python38.zip',
'C:\\PythonHome\\DLLs',
'C:\\PythonHome\\lib',
'D:\\Python38',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00008bd8 (most recent call first):
<no Python frame>
通过上面的配置发现,在新装或更新了python后环境变量并没有改变,一是可能环境变量没有修改,另一种原因是你修改了环境变量后没有重启系统。很鬼的,这个环境变量的修改必须重启系统才能效。