I have a Python3/PyQT5 app, frozen using PyInstaller. On macOS my Python3 code runs fine from a CLI. The version frozen using PyInstaller also runs successfully but creates new copies of itself every couple of seconds in what looks like an infinite loop.
By way of background I have successfully frozen this app on Ubuntu 18.05 and Windows 10 without seeing this problem.
I am running Python 3.7.2 with PyInstaller 3.4 and PyQT5 5.12, on macOS Mojave 10.14.3.
Given the Python code runs perfectly from the CLI and from PyCharm, and the frozen package runs (but with multiple copies of itself) it looks like the problem is somewhere in the freezing process. I am not directly using multiprocessing but am using scikit-learn (sklearn) that does, I believe, use multiprocessing. I have tried calling freeze_support() at the top, and various other places but none fix the problem.
My .spec file for PyInstaller does have sklearn as a hidden import. I know that freeze_support() should be called before sklearn so I wonder if having sklearn as a hidden import in the .spec file is somehow causing the problem? Other than that I have hit a brick wall. Can anyone suggest how we can get to the bottom of this problem please?
My .spec file is here: