1. 当程序中没有调用 matplotlib 模块
1 pip intall pyinstaller
2 在 cmd 环境下, pyinstaller -F xxx.py
2. 当程序中调用 matplotlib 模块
1pip install pyinstaller
2在 cmd 环境下, chcp 65001 切换 utf-8
3将 D:\Anaconda2\Library\plugins\platforms 文件夹拷贝放到和. exe 同一路径下
来源: http://www.bubuko.com/infodetail-3281503.html