【发布时间】:2016-09-16 03:19:14
【问题描述】:
我正在使用 python 3.5 和 pyinstaller 版本 3.1.1。我指定了一个名为 SCADAsync_spec.spec 的 .spec 文件,如下所示:
block_cipher = None
a = Analysis(['SCADAsync.py'],
pathex=['C:\\repo\\analysis\\trunk\\source\\python\\functions', 'C:\\repo\\analysis\\trunk\\source\\python\\Executables'],
binaries=None,
datas=[('figs\\ROMO_icon.ico','figs'),('figs\\OpenFile2.gif','figs'),('figs\\ROMOWind_Logo2015_CMYK.png','figs')],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='SCADAsync',
debug=True,
strip=False,
upx=True,
console=True
)
使用
执行时效果很好pyinstaller SCADAsync_spec.spec
现在创建了两个大文件夹(dist 和 build),我更愿意将它们存储在默认目录之外的其他位置。有谁知道如何在规范文件中设置这些文件夹的位置?我想让我的命令行命令尽可能简单,即 .exe 应该只通过键入来构建
pyinstaller SCADAsync_spec.spec
从 Pyinstaller 手册看来,我可以为规范文件 (https://pythonhosted.org/PyInstaller/spec-files.html) 指定名为“DISTPATH”和“工作路径”的全局变量。但我真的不知道该怎么做。
任何帮助将不胜感激!
尼克
【问题讨论】:
标签: python pyinstaller