python3.6.1 打包成.exe可执行文件

来源:互联网 发布:雅典娜女神像 淘宝 编辑:程序博客网 时间:2024/06/06 14:01

环境:

python3.6.1 win10

1、下载pyinstaller.
2、下载并安装pywin32 (根据自己的python版本我的对应版本pywin32-220.win-amd64-py3.6.exe)
3、进入pyinstaller文件夹
执行 python pyinstaller.py会出现以下内容,说明安装成功
这里写图片描述
4、打包,选好自己的写的一个python程序( 例如hello.py),将他放到pyinstaller目录下,然后执行以下命令:

pyhton pyinstaller.py -F hello.py

会生成一个hello文件夹,所打包好的exe文件就在dist目录下。

注:其中需要注意的几个问题。
1、当报错ImportError: No module named pefile
安装这个模块就好
2、IndexError:tuple index out of range错误
https://github.com/pyinstaller/pyinstaller重新下载源码即可

参考链接:
http://blog.csdn.net/pijk123/article/details/76222460
http://www.jianshu.com/p/a2dbb346164a

原创粉丝点击