python 安装 pyinstall 编译exe文件

$ pip install future

安装PyInstaller之前需确认首先安装了pywin32

 

PyInstaller安装
  1. 1

    下载地址:http://www.pyinstaller.org/wiki

     

    2
  2. 最新版本:PyInstaller 2.0

     

     

     
  3. 3

    直接“解压缩”之后即可使用,解压到您想让他在的路径即可

     

     

PyInstaller配置

  1. 1

    事先写好py程序

     

     

     

     
  2. 2

    在命令行执行:Python Makespec.py --console --onefile NotePad\notepad.py

    报错:Configfile is missing or unreadable. Please run Configure.py before building

     

     

     

     
  3. 3

    在命令行执行:Configure.py

    报错:Python 2.6+ on Windows support needs pywin32,Please install http://sourceforge.NET/projects/pywin32/

     

     

     

     

     
  4. 4

    安装最新版本的 pywin32-217.win32-py2.7.exe,下载地址:http://sourceforge.Net/projects/pywin32/files/pywin32/Build%20217/

     

     

     

     

PyInstaller使用

PyInstaller的使用相对简单,cmd下进入解压出来的目录,执行如下命令:

python pyinstaller.py [opts] yourprogram.py

主要选项包括:

-F, -onefile 打包成一个exe文件

-D, -onedir 创建一个目录,包含exe文件,但会依赖很多文件(默认选项)

-c, -console, -nowindowed 使用控制台,无界面(默认)

-w, -windowed, -noconsole 使用窗口,无控制台

转载于:https://www.cnblogs.com/Devopser/p/6474222.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值