1. 当程序中没有调用matplotlib模块
① pip intall pyinstaller
② 在cmd环境下,pyinstaller -F xxx.py
2.当程序中调用matplotlib模块
①pip install pyinstaller
②在cmd环境下,chcp 65001 切换utf-8
③将D:\Anaconda2\Library\plugins\platforms文件夹拷贝放到和.exe同一路径下
原文:https://www.cnblogs.com/LuckPsyduck/p/11830828.html