pyInstaller

1.下载PyInstaller 。地址http://www.pyinstaller.org/

2.解压 ,将需要打包的py程序放到pyinstaller目录下

3.pyinstaller依赖一些windows的组件,需要到http://sourceforge.net/projects/pywin32/   下载相应python的版本,

例如:python2.7的32位版:pywin32-218.win32-py2.7.exe

放到pyinstaller目录下

4.测试pyinstall安装是否正确

进入pyinstaller目录,试运行看看是否安装正确。  
以下是运行屏幕:  
C:\>cd c:\pyinstaller    
C:\pyinstaller>c:\python27\python pyinstaller.py 

Error: PyInstaller for Python 2.6+ on Windows needs pywin32.  
Please install from http://sourceforge.net/projects/pywin32/    
#上面的错误提示安装pywin32-218.win32-py2.7.exe。    
C:\pyinstaller>c:\python27\python pyinstaller.py  
Usage: python pyinstaller.py [opts] <scriptname> [ <scriptname> ...] | <specfile>    
pyinstaller.py: error: Requires at least one scriptname file or exactly one .spec-file    
# 以上信息表示可以开展工作了。


5.开始打包

C:\pyinstaller>c:\python27\python pyinstaller.py --console --onefile  convert.py

....

会生成convert目录,在build下生成convert.exe

提示:

如果出现Error loading Python DLL: E:\download\PYINST~1.1\CONVER~1\build\CONVER~1\python2
7.dll (error code 126)错误

搜索系统中的python27.dll,放到convert.exe目录下或者window



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值