'Pyinstaller MacOS Application launching twice

I have an application written in Python and TKInter and complied with PYInstaller.

Recently compiled versions appear to launch twice. When I double-click on the .app, it seems to launch then quit. Its icon appears momentarily in the dock, and disappears. After a few seconds, the application launches as intended.

I am using Python 3.9. I have tried this with and without code signing.

What would be causing this and is this a sign of something worse?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source