C:\Users\JoJo>python
Fatal Python error: init_stdio_encoding: failed to get the Python codec name of the stdio encoding
Python runtime state: core initialized
LookupError: unknown encoding: 8
Current thread 0x00004404 (most recent call first):
<no Python frame>
報錯如上。
系統:windows 64位
版本:python 3.8.3
uj5u.com熱心網友回復:
這個問題找到答案了,有兩個原因:1、pc上安裝了mingw環境,mingw安裝了python2.7;
2、mingw安裝的python2.7的環境變數是有問題的,如下,
PYTHONIOENCODING:8
修改方法:
1、卸載已安裝的python 3.8.3;
2、修改環境變數,如下:
PYTHONIOENCODING:UTF8
實測python可以正常使用,運行的版本是python2.7。
為了使用最新版本的python
1、卸載mingw的環境,洗掉python2.7;
2、安裝python3.8.3;
實測python可以正常使用,運行的版本是python3.8.3。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/29988.html
