在Python 2.7.15\Lib\site-packages目录下面新建一个文件名为sitecustomize.py在里面写上 import sys sys.setdefaultencoding('gbk')