1.在PythonLibsite-packages目录下创建一个sitecustomize.py文件 源代码: import sys sys.setdefaultencoding('utf-8')
2.验证。 打开IDLE,在里面输入: import sys sys.getdefaultencoding()
3.得到结果: utf-8