Fatal Python Error when running exe

55 views
Skip to first unread message

Tom Johnson

unread,
Jun 8, 2022, 9:28:52 AM6/8/22
to PyInstaller
Hi there,

my python program is compiling fine and running fine when executed through a command line or batch file or even a test program. However, when trying to integrate it into a larger application it simply won't start. I downloaded DebugView to see what was happening because it was obvious the exe was opening but not running.

What I found was that as the internal python interpreter was unpacked and started, it ran into a fatal Python error: failed to get random numbers to initialize Python.

Has anyone run into this before? I think it is happening because we are running this app through a custom executable framework that changes some of the env variables. Realistically I am wondering if I can write a hook to set this env variable back to what it should be before the python interpreter starts.

Thanks for any help!

Tom Johnson

unread,
Jun 8, 2022, 10:11:51 AM6/8/22
to PyInstaller
One thing I have found is to make sure that the env variable SYSTEMROOT is appropriately set but - how do I do this? What do I set it to?

Jasper Harrison

unread,
Jun 8, 2022, 10:20:05 AM6/8/22
to pyins...@googlegroups.com
Tom,

Thanks for your mail! Would you be able to open an issue on the PyInstaller GitHub repository? We'd be able to help you more there.

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/66e60aa5-72ec-4178-b199-75d89b9bfce1n%40googlegroups.com.

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

Tom Johnson

unread,
Jun 8, 2022, 11:00:36 AM6/8/22
to PyInstaller
Thanks Jasper, I will do this. I tried to write a runtime hook to initialize the env variable to C:\Windows but the hooks run after the python interpreter is already initialized , so no luck there.
Reply all
Reply to author
Forward
0 new messages