PyInstaller error loading Python DLL when running executable on another machine

8,431 views
Skip to first unread message

Daniel Keehl

unread,
Jun 7, 2022, 4:13:22 AM6/7/22
to PyInstaller

I'm trying to run a pyinstaller-built executable on another machine. The error I see is Error loading Python DLL 'C:\Users\User\AppData\Local\Temp\_MEI70722\python39.dll

I built the program like this, I also added -F to make sure the executable is standalone:

py -m PyInstaller script.py -F

I tried adding --add-binary and --add-data options with the path to python39.dll, but that didn't help.

The program is built on Windows 10 x64, the machine I'm trying to run the program on is Windows 7 x64. Even with such a difference and the fact that Python 3.9 is not for Windows 7, I really doubt this is the reason, otherwise I would expect another error.

What am I doing wrong?

Daniel Keehl

unread,
Jun 7, 2022, 4:13:25 AM6/7/22
to PyInstaller

Jasper Harrison

unread,
Jun 8, 2022, 6:48:03 AM6/8/22
to pyins...@googlegroups.com
Daniel

PyInstaller doesn't support Windows 7 anymore. However, the issue is probably due the fact that the Python DLL is incompatible with Windows 7. That error message is caused by the system being unable to load the DLL - in the case of windows, the LoadLibraryExW function returned NULL.

I'd hazard a guess that the issue is something to do with the windows libc versions being incompatible, however that may not be the cause. Either way, we can't really offer any support as the project no longer supports Windows 7.

Jasper Harrison, aka Legorooj
Core Developer on PyInstaller

------- Original Message -------
--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3fe04e28-b249-4464-bf3a-f272cb403ac0n%40googlegroups.com.

publickey - legorooj@protonmail.com - 0x164CF234.asc
signature.asc

bwoodsend

unread,
Jun 8, 2022, 6:51:40 AM6/8/22
to PyInstaller

Python 3.9 not supporting Windows 7 is the reason. python39.dll is linked against libraries which only exist on Windows >= 8.1 so it fails to load. If you want to support Windows 7 then you should be building on Windows 7 so that you aren’t picking up libraries which are similarly dependent on newer Windows libraries.

Reply all
Reply to author
Forward
0 new messages