Pyinstaller将使用onefile创建可执行文件,但不能没有i

2024-09-30 00:41:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我遇到的问题是当我运行pyinstall时绘图gui.spec,它创建一个工作的--onefile.exe。问题是我不想要一个文件,就像我有东西写入文件一样,而且删除临时目录是没有用的。所以我想在没有--onefile命令的情况下创建一个exe,但是我所做的一切都不起作用。新的规范文件提供了一个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用户,只需要它来完成这个项目。)我在windows7 64位上运行winpython32bit 2.7.6.4(我需要32位python作为一个模块)

以下是创建工作--onefile exe的规范文件:

^{pr2}$

这是另一个不能正常工作的等级库文件。在

# -*- 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')

编辑:我找到了程序的事件日志。这似乎是微软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.

我尝试过重新安装一些visualstudio,但毫无帮助。在


Tags: 文件nonefordataexeusersdocumentsnpy
1条回答
网友
1楼 · 发布于 2024-09-30 00:41:14

所以,经过一番挣扎,我尝试使用py2exe,但也失败了,然后切换到cx_freeze。在用cx_freeze编译之后,它会发出一条错误消息,基本上告诉我代码的哪一部分没有所需的dll。结果,由于某种原因,SeaBorn导致了这个错误。通过注释,上面的规范文件适用于代码。在

相关问题 更多 >

    热门问题