import sys sys.reload() sys.getdefaultencoding() # 查看设置前系统默认编码 sys.setdefaultencoding('utf-8') sys.getdefaultencoding() # 查看设置后系统默认编码