我遇到的问题是,当我运行pyinstall plotGUI.spec时,它会创建一个工作--onefile .exe。问题是我不想要一个文件,看到我如何写文件,并删除临时目录是没有用的。所以我想创建一个没有--onefile命令的exe,我所做的一切都没有用。新的spec文件给我一个exe,它返回以下错误信息:
The application has failed to start because its side-by-side configuration is incorrect.
Please see the application event log or use the command-line sxstrace.exe tool for more details.
我不知道应用程序日志在哪里或者如何使用sxstrace(我通常不是Windows用户,只需要它用于此项目。)我在Windows 7 64位上运行WinPython 32bit 2.7.6.4(我需要一个模块的32位python。)
这是我的spec文件,它创建了工作--onefile exe:
# -*- mode: python -*-
a = Analysis(['plotGUI.py'],
pathex=['C:\\Users\\Wesley\\Documents\\DirtScanner'],
hiddenimports=['scipy.special._ufuncs_cxx','PySide.QtCore','PySide.QtGui'],
hookspath=None,
excludes=['PyQt4'],
runtime_hooks=None)
a.datas += [('DejaVuLogo.ico', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\DejaVuLogo.ico', 'DATA'),('DejaVuLogo.png', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\DejaVuLogo.png', 'DATA'),('temp.npy', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\temp.npy', 'DATA'),('threshold.npy', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\threshold.npy', 'DATA')]
for d in a.datas:
if 'pyconfig' in d[0]:
a.datas.remove(d)
break
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='DirtScanner.exe',
debug=True,
strip=None,
upx=True,
console=True ,
icon='DejaVuLogo.ico')
这是另一个无效的spec文件。
# -*- mode: python -*-
a = Analysis(['plotGUI.py'],
pathex=['C:\\Users\\Wesley\\Documents\\DirtScanner'],
hiddenimports=['scipy.special._ufuncs_cxx','PySide.QtCore','PySide.QtGui'],
hookspath=None,
excludes=['PyQt4'],
runtime_hooks=None)
a.datas += [('DejaVuLogo.ico', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\DejaVuLogo.ico', 'DATA'),('DejaVuLogo.png', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\DejaVuLogo.png', 'DATA'),('temp.npy', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\temp.npy', 'DATA'),('threshold.npy', 'C:\\Users\\Wesley\\Documents\\DirtScanner\\threshold.npy', 'DATA')]
for d in a.datas:
if 'pyconfig' in d[0]:
a.datas.remove(d)
break
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='plotGUI.exe',
debug=False,
strip=None,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='plotGUI')
编辑:我找到了该程序的事件日志。这似乎是Microsoft Visual的一个问题,特别是调试,但为什么它会与一个问题而不是另一个问题?
Activation context generation failed for
"C:\Users\Wesley\Documents\DirtScanner\dist\plotGUI\plotGUI.exe.Manifest".
Dependent Assembly
Microsoft.VC90.DebugCRT,processorArchitecture="x86",
publicKeyToken="1fc8b3b9a1e18e3b",type="win32",
version="9.0.21022.8" could not be found.
Please use sxstrace.exe for detailed diagnosis.
我曾尝试重新安装一些视觉工作室,但所以没有任何帮助。
答案 0 :(得分:0)
所以,经过多次努力,我尝试使用py2exe,它也失败了,然后切换到cx_freeze。在使用cx_freeze进行编译之后,它会发出一条错误消息,基本上告诉我代码的哪一部分没有所需的dll。事实证明,由于某种原因,SeaBorn导致了错误。通过注释,上面的规范文件适用于代码。