7

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?

4 Answers 4

6

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)

Sign up to request clarification or add additional context in comments.

1 Comment

I had the same issue in the past and I found an option to exclude vcruntime140.dll from UPX process by adding --upx-exclude FILE to prevent a binary from being compressed when using upx. This is typically used if upx corrupts certain binaries during compression. FILE is the filename of the binary without path. This option can be used multiple times. pyinstaller --upx-exclude=vcruntime140.dll --onefile --windowed get.py Soucer: pyinstaller.readthedocs.io/en/stable/…
5

I have also met this issue, and the root cause is that I am using upx to compress the file size. The solution is to exclude files which should not be compressed by upx:

pyinstaller --onefile --console --upx-dir=/path/to/upx --upx-exclude=vcruntime140.dll --upx-exclude=python36.dll my_script.py

Comments

1

In my case it was:

pyinstaller  --clean --win-private-assemblies --noupx --onedir --onefile script.py

--windowed caused problems with wxWidgets

Comments

1

I tried with this version of Pyinstaller commands, Add this commands to a .bat file and execute the .bat file. It worked for me:

pyinstaller --log-level=WARN ^
    --upx-dir <PATH_TO_UPX.exe_FILE> ^
    --upx-exclude vcruntime140.dll ^
    --upx-exclude ucrtbase.dll ^
    --upx-exclude qwindows.dll ^
    --upx-exclude libegl.dll ^
    --name <NAME_OF_APPLICATION> ^
    --onefile --windowed ^
    <PY_DEPENDENT_FILES.py>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.