Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyinstaller onefile does not start on some Windows 7 machines

I have created an exe file which works fine on some Windows machines and fails on others.

I could not yet find the cause for failing.

Important data:

  • x64 exe
  • Windows 7
  • Python 3.5.1
  • pyinstaller 3.0
  • onefile

The DEBUG shows the following:

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

There is also an error message shown in a window:

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 

When I copy all files from C:\temp_MEI55762 (where the bootloader has extracted all files) to the directory C:\temp\r (where mytool_debug.exe is located) and execute mytool_debug.exe it works.

As said mytool.exe works on other Windows 7/8 computers well. I have found 2 computers where it does not because of above error.

Where should I start searching?

like image 445
kotlet schabowy Avatar asked Dec 11 '15 07:12

kotlet schabowy


2 Answers

After installing around 200 Windows updates the error is gone.

The required update is addressed by KB2999226

like image 184
kotlet schabowy Avatar answered Oct 20 '22 00:10

kotlet schabowy


There's a discussion about this here working towards a build side solution rather than having to install the Windows Update: https://github.com/pyinstaller/pyinstaller/issues/1566 . As of today (9th May 2017) there's still no firm solution. There are 2 solutions that have worked for some people:

  • Install the Windows 10 SDK and add the ucrt DDL dirs to your system path (C:\Program Files\Windows Kits\10\Redist\ucrt or C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64 depending on your system) before building

  • Use Python 3.4 to build instead of 3.5+

like image 23
Daniel Holmes Avatar answered Oct 19 '22 23:10

Daniel Holmes