【问题标题】:Pyinstaller onefile does not start on some Windows 7 machinesPyinstaller onefile 在某些 Windows 7 机器上无法启动
【发布时间】:2016-03-17 01:25:06
【问题描述】:

我创建了一个 exe 文件,它在某些 Windows 机器上运行良好,而在其他机器上却失败了。

我还没有找到失败的原因。

重要数据:

  • x64 exe
  • Windows 7
  • Python 3.5.1
  • pyinstaller 3.0
  • 一个文件

DEBUG 显示如下:

C:\temp\r>mytool_debug.exe
PyInstaller Bootloader 3.x
LOADER: executable is C:\temp\r\mytool_debug.exe
LOADER: homepath is C:\temp\r
LOADER: _MEIPASS2 is NULL
LOADER: archivename is C:\temp\r\mytool_debug.exe
LOADER: Extracting binaries
LOADER: Executing self as child
LOADER: set _MEIPASS2 to C:\temp\_MEI55762
LOADER: Setting up to run child
LOADER: Creating child process
LOADER: Waiting for child process to finish...
PyInstaller Bootloader 3.x
LOADER: executable is C:\temp\r\mytool_debug.exe
LOADER: homepath is C:\temp\r
LOADER: _MEIPASS2 is C:\temp\_MEI55762
LOADER: archivename is C:\temp\r\mytool_debug.exe
LOADER: SetDllDirectory(C:\temp\_MEI55762)
LOADER: Already in the child - running user's code.
LOADER: manifestpath: C:\temp\_MEI55762\mytool.exe.manifest
LOADER: Activation context created
LOADER: Activation context activated
LOADER: Python library: C:\temp\_MEI55762\python35.dll
Error loading Python DLL: C:\temp\_MEI55762\python35.dll (error code 127)
LOADER: Back to parent (RC: -1)
LOADER: Doing cleanup
LOADER: Freeing archive status for C:\temp\r\mytool_debug.exe

还有一个错误信息显示在一个窗口中:

Entry Point Not Found

The procedure entry point ucrtbase.terminate could not be located in the dynamic link library api-ms-win-crt-runtime-l1-1-0.dll 

当我将所有文件从 C:\temp_MEI55762(引导加载程序提取所有文件的位置)复制到目录 C:\temp\r(mytool_debug.exe 所在的位置)并执行 mytool_debug.exe 时,它​​可以工作。

如前所述,mytool.exe 在其他 Windows 7/8 计算机上运行良好。由于上述错误,我找到了 2 台计算机。

我应该从哪里开始搜索?

【问题讨论】:

    标签: windows pyinstaller


    【解决方案1】:

    安装大约 200 个 Windows 更新后,错误消失了。

    KB2999226 解决了所需的更新

    【讨论】:

    • 缺少的修补程序是:KB2999226
    • 谢谢,这行得通。另一个似乎对所有 Windows 版本都打包得更好的页面:microsoft.com/en-in/download/details.aspx?id=48234
    • 需要明确的是,此修补程序是否需要应用于构建应用程序的计算机、运行应用程序的客户端,或两者兼而有之?
    【解决方案2】:

    这里有一个关于这个的讨论,致力于构建端解决方案,而不是必须安装 Windows 更新:https://github.com/pyinstaller/pyinstaller/issues/1566。截至今天(2017 年 5 月 9 日),仍然没有确定的解决方案。有 2 种解决方案对某些人有效:

    • 安装 Windows 10 SDK 并将 ucrt DDL 目录添加到您的系统路径(C:\Program Files\Windows Kits\10\Redist\ucrt 或 C:\Program Files (x86)\Windows Kits\10 \Redist\ucrt\DLLs\x64 取决于您的系统)在构建之前

    • 使用 Python 3.4 构建而不是 3.5+

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-21
      • 2020-09-12
      • 2018-05-15
      • 2017-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多