python的编码问题一直是头痛。比方matplotlib绘图仅仅接受utf-8编码,假设没有设置就会在绘图时报错。 有时间整整这个python编码;

如标题所看到的。解决方式:增加

import sys
reload(sys)
sys.setdefaultencoding("utf-8")