New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyinstaller multiprocessing name of process is always "MainProcess" #3957
Comments
Are you using |
Please also state wich exact version of PyInstaller you are using. Please try the current development head. |
@htgoebel I'm using pyinstaller 3.4 on python 2.7. Using it in the regular mode with the folder? Not one single file.exe. I tried using it on python 3.6 but it was kind of tricky to have it set to compile under python 3.6 by default instead of 2.7 |
PyInstaller: 3.5.dev0+1844d69f5 version still has the same issue |
Please try putting |
@htgoebel Doesn't work: MainProcess Press Enter or Esc to close console... |
This fixed the described issue for me. Note: I had put |
Issue still there when I'm using Python 3.7.4 now. |
I had very similar problems and was able to get rid of the AttributeError ... Failed to execute script... |
Python 3.5, PyInstaller 3.5 |
Any progress on this? I'm experiencing this on Mac OS where a new process also named if __name__ == '__main__':
multiprocessing.freeze_support()
if 'main_started' not in os.environ:
os.environ['main_started'] = ''
start() |
On MacOS Big Sur, fixed as htgoebel suggested:
It seems critical that |
Python の公式ドキュメントでは、Windows 以外では freeze_support() の呼び出しは効果がないと記載されている。しかし、macOS Big Sur 11.2.2, Python 3.9.1, PyInstaller 4.2 において、メインプロセスが多重に 呼び出される現象が発生し、その回避策として PyInstaller リポジトリの Issue にて freeze_support() を呼ぶことが有効だと報告されていた。 cf. pyinstaller/pyinstaller#3957
Using It allows PyInstaller to insert a hook that handles process spawning in the frozen application. This works differently than in unfrozen mode, because there's no This is why omitting this call results in infinite process spawning loop; as each spawned auxiliary or worker process thinks it is main process, and executes main code, and therefore eventually tries to use And this is why you should make the call to
|
Here's my test code (py 2.7 on Windows):
Without compiling, the code works fine as it prints out
After using pyinstaller on it, unfortunately it will always default to "MainProcess". Result as follows:
The text was updated successfully, but these errors were encountered: