一、安装pyinstaller
pip install pyinstaller
![](https://i-blog.csdnimg.cn/blog_migrate/28dca145a5f0ba10eab4486829acea60.png)
二、打包制定py文件
D:\py_space>pyinstaller -F -w test.py
双击红色方框里的.exe即可
![](https://i-blog.csdnimg.cn/blog_migrate/510e2f7035fe331c59e1d50cc8f693e8.png)
三、
pyinstaller 指令解释:
-F 将py文件打包为可执行文件
-w 打包后文件执行不展示命令行窗口
-c 打包后文件执行展示命令行窗口
指定打包后exe文件的位置:
上面的打包语句加上另一个参数 --distpath=exe文件存放位置
D:\py_space>pyinstaller -F -w test.py --distpath=D:\py_space