输出报错
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
>>> import sys
>>> sys.stdout.encoding
'ANSI_X3.4-1968'
卸载Python
apt remove --purge python*
安装Python
apt install python3
apt install python3-pip
import sys import io sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
标签:编码,stdout,Python,apt,sys,默认,io,import,Python3 From: https://www.cnblogs.com/haiton/p/11308510.html