控制参数:--specpath DIR Folder to store the generated spec file (default: current directory) 使用pyinstaller时,默认会在当前的路径下生成一个以spec为后缀的打包配置文件,pyinstaller依据spec文件的内容来创建exe文件; 正常情况下,不需要去修改这个spec文件,除非需要打包其他数据文件; build/ 存放过程文件,事后可...
例如一个简单的文件处理工具,包含两个文件,generate_file.py和main.py,main.py是程序的入口。 首先生成.spec文件,在项目根目录下使用命令pyi-makespec -F -w main.py,如下图中的红色图标文件: -F是为了打包成整个的exe可执行文件 -w是为了不显示console 修改.spec文件内容,原始内容如下所示: 修改后的内容: ...
--specpathDIR Folder to store the generated spec file (default: current directory) -nNAME,--nameNAME Name to assign to the bundled app and spec file (default: first script's basename) What to bundle, where to search: --add-data <SRC;DEST or SRC:DEST> Additional non-binary files or ...
What to generate: -F, --onefile create a single file deployment -D, --onedir create a single directory deployment (default) -oDIR, --out=DIR create the spec file in directory. If not specified, and the current directory is Installer’s root directory, an output subdirectory will be creat...
What to generate: -F, --onefile create a single file deployment -D, --onedir create a single directory deployment (default) -o DIR, --out=DIR create the spec file in directory. If not specified, and the current directory is Installer's root directory, an output subdirectory will be cre...
What to generate: -D, --onedir Create a one-folder bundle containing an executable (default) -F, --onefile Create a one-file bundled executable. --specpath DIR Folder to store the generated spec file (default: current directory)
What to generate: -D, --onedir Create a one-folder bundle containing an executable (default) -F, --onefile Create a one-file bundled executable. --specpath DIR Folder to store the generated spec file (default: current directory)
The PyInstaller .spec file is mean to be portable across the three platforms that it supports: Windows, Mac OS X and Linux. I find it much easier to generate the .spec file once and modify it at will before building an executable from it. In every example on the Interne...
Generate the.specfile. Windows:(You want a single EXE file with your data in it, hence--onefile). python pyinstaller.py --onefile your_main_file.py Mac OS X:(You want an App bundle with windowed output, hence--windowed). python pyinstaller.py --windowed your_main_file.py ...
If app works after this, you can edit .spec file to bundle these folders automatically (pyinstaller generate .spec-file on first run). # -*- mode: python -*- import os import site block_cipher = None site_packages_dir = site.getsitepackages()[1] qml_dir = os.path.join(site_package...