Search code examples
pythonpython-3.xexepyinstaller

Error when creating executable file with pyinstaller


I'm trying to create an exe for my python script using pyinstaller each time it runs into errors which can be found in a pastebin here.

Also when I double click the exe file it shows this error:

C:Users\Afro\AppData\Local\Temp_MEI51322\VCRUNTIME140.dll is either not designed to run on windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0xc000007b

and then this:

Error loading Python DLL: C:\Users\Afro\AppData\Local\Temp_MEI51322\python35.dll(error code 193)

what's wrong, please?


Solution

  • I was haunted with similar issue. It might be that in your case UPX is breaking vcruntime140.dll. Solution to this is turning off UPX, so just add --noupx to your pyinstaller call.

    pyinstaller --noupx --onedir --onefile --windowed get.py
    

    Long explanation here: UPX breaking vcruntime140.dll (64bit)