在脚本的开头添加下面三行代码就可以了
import sys import io sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')