`
zerxd
  • 浏览: 71449 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

PyInstaller2.0 使用

 
阅读更多

各版本的PyInstaller的使用方式大不相同。

PyInstaller2.0英文手册:

http://www.pyinstaller.org/export/v2.0/project/doc/Manual.pdf?format=raw

在下载的PyInstaller文件中有PDF使用手册。

 

Windwos中使用PyInstaller,需要pywin32

http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/

 

手册要点:

1、假设解压至E:/PyInstaller中,如果在该目录中运行python pyinstaller.py [opts]  your-program.py,会在该目录下生成一个your-program的文件夹,并且在该文件夹下会生成dist、build、spec文件。如果是在其它目录中运行,例如python e:/PyInstaller/pyinstaller.py [opts] your-program.py 会在该目录下生成dist、build、spce文件,即不会生成your-program文件夹。[opts]是可选项。

如果成功生成spec文件之后,运行python pyinstaller.py [opts] your-program.spec。

要做的差不多就是这些,如果有其它的选项需要,可以看“Allowed OPTIONS",如果还是不行,看"Spec Files"的介绍。

 

2、引用数据文件

1)修改你的程序:

basedir = os.path.dirname(__file__)

 

if getattr(sys, 'frozen', None):

     basedir = sys._MEIPASS

else:

     basedir = os.path.dirname(__file__)

 

2)收集数据文件

数据的收集是放在spec文件中。

 

 

 

 

遇到的问题

1、section xx 找不着,在配置文件中的配置无法找到。

 

2、No module named xx.xx.xx 找不能某定自定义的模块。

 

3、在Linux下运行pyinstaller.py时,有Python library not found!错误。

(这可能是因为Python是动态编译还是静态编译的问题,或者是多版本Python的原因。)

 

可参考:

http://www.crifan.com/use_pyinstaller_to_package_python_to_single_executable_exe/

分享到:
评论

相关推荐

    PyInstaller Extractor v2.0

    PyInstaller Extractor v2.0 (Supports pyinstaller 5.3, 5.2, 5.1, 5.0.1, 5.0, 4.10, 4.9, 4.8, 4.7, 4.6, 4.5.1, 4.5, 4.4, 4.3, 4.2, 4.1, 4.0, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.1, 2.0) Author : Extreme...

    pyinstaller-pyinstaller-v3.2.1-183-g964547c.zip

    用于打包python 程序为exe 命令:bat set/p option= input file Name: python E:\Tools\pyinstaller-2.0\pyinstaller.py -F -c %option% pause

    pyinstxtractor:PyInstaller提取器

    已并支持Pyinstaller 2.0、2.1、3.0、3.1、3.2、3.3、3.4、3.5、3.6、4.0、4.1、4.2版本。可能也可以与其他版本一起使用。 该项目最初在上。 如何使用 可以通过传递exe名称作为参数来运行脚本。 $ python ...

    PyInstxtractor 2.0.rar

    PyInstxtractor 2.0 《PyInstaller封装程序反编译 PyInstxtractor + Uncompale》(https://blog.csdn.net/ZH013/article/details/105116715)用到的代码。

    PyInstaller打包程序解包,反编译工具

    支持的python版本:1.0、 1.1、 1.3、 1.4、 1.5、 1.6、 2.0、 2.1、 2.2、 2.3、 2.4、 2.5、 2.6、 2.7、 3.0、 3.1、 3.2、 3.3、 3.4、 3.5、 3.6、 3.7、 3.8、 3.9、 3.10、3.11。可能会存在部分文件无法反...

    pyinstxtractor.py

    可以反编译未加密的pyinstaller生成的exe文件,支持Pyinstaller versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 and 4.0 使用教程:https://blog.csdn.net/ZhaDeNianQu/article/details/87717293

    openGL打包库

    glut32.lib gcc和VC都可以使用的glut32.dll的导入库 libglut32.a gcc用的导入库. libglaux.a VC自带有对应的glaux.lib,这是给gcc用的 glut好像不能静态编译,使用了专用的dll入口函数.glut32.lib和glut32.dll是...

    Python打包exe环境

    Python打包exe环境,经过测试,可在win10x64,xp-x86上面安装使用,打包出来的exe可在32位系统下运行, python2.7.14 32位,pywin32,pyinstaller-2.0 ,upx308w

    自动刷屏工具-V2.0

    (增加新功能:可通过网络下载系统素材!)利用python语言编写,pyinstaller库打包的原创小工具,适用于enter键发送信息的通信软件

    发票合并_V2.0.exe

    详情介绍看这里 https://blog.csdn.net/matrix273/article/details/87365644 新的V2.0版本支持GUI选择啦,支持多张发票输入合并到一个PDF文件中.从而节约用纸!!!

    产品狗的Python之路(2):excel表格拆分桌面小程序

    使用tkinter将excel表格拆分脚本制作了GUI,并使用pyinstaller封装成了桌面程序 import tkinter as tk import openpyxl # v2.0 版本规划; # 增加文件不存在的时候的报错; # 优化布局展示; # 优化绝对路径取值; ...

    PSU-Pozyx-GUI-source:与Pozyx(R)Local Positioning System设备接口的软件应用程序的源代码-ps source code

    PSU-Pozyx-GUI源 ...使用PyInstaller和脚本compile_python_scripts将python脚本构建为可执行包 如有必要,更新pom.xml mvn clean mvn package 作者 加布里埃尔·穆科比(Gabriel Mukobi) 权浩 拉尔

    发票合并_V1.2.exe

    已经有发票合并工具2.0了,推荐大家升级!!! 下载链接:https://download.csdn.net/download/matrix273/12303143 详情介绍看这里 https://blog.csdn.net/matrix273/article/details/87365644 新的V1.2版本支持...

    发票合并工具1.00

    已经有发票合并工具2.0了,推荐大家升级!!!,下载链接: https://download.csdn.net/download/matrix273/12303143 资源介绍:https://blog.csdn.net/matrix273/article/details/87365644 合并两个单页面的PDF...

    unlocker208 —— VMware 安装 MacOS的必备补丁

    Windows has a packaged version of the Python script using PyInstaller, and so does not require Python to be installed. 3. Limitations -------------- If you are using VMware Player or Workstation on ...

    vmware unlocker 2.0.6最新版(vm虚拟机破解安装Mac OS)

    Mac OS X Unlocker for VMware V2.0 1. Introduction Unlocker 2 is designed for Workstation 11, Player 7, ESXi 6 and Fusion 7. If you are using an earlier product please continue using Unlocker 1 ...

    macOS Unlocker 2.1 for VMware Workstation 11/12/14(VM14破解补丁)

    Windows Unlocker has a packaged version of the Python script using PyInstaller, and so does not require Python to be installed. 3. Limitations -------------- If you are using VMware Player or ...

Global site tag (gtag.js) - Google Analytics