2021-10-08

Fatal Python error: init_fs_encoding: failed to get the Python codec of the file

1.平台:VS2017+Boost.python+Anaconada
2.原因:因计算机环境设置不全;
3.错误提示的完整信息:
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘python’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘F:\Documents\Visual Studio 2017\Projects\Project1
\x64\Debug\Project1.exe’
sys.base_prefix = ‘C:\Users\usts181009\anaconda3’
sys.base_exec_prefix = ‘C:\Users\usts181009\anaconda3’
sys.executable = ‘F:\Documents\Visual Studio 2017\Projects\Project1\x64\
Debug\Project1.exe’
sys.prefix = ‘C:\Users\usts181009\anaconda3’
sys.exec_prefix = ‘C:\Users\usts181009\anaconda3’
sys.path = [
‘C:\Users\usts181009\anaconda3\python38.zip’,
‘.\DLLs’,
‘.\lib’,
‘F:\Documents\Visual Studio 2017\Projects\Project1\x64\Debug’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the file
system encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

4.错误出现时机:Debug
5.参照其它大咖的提示:Fatal Python error: initfsencoding: unable to load the file system codec. Module
6.处理方法:]
2021-10-08_第1张图片
6.接下来,重启Visual Studio,否则可能依旧会报错

你可能感兴趣的:(python,c++,visualstudio)