Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python PyInstaller Executable oneFile is launched multipletimes "unexpectedly" | multiprocessing

$
0
0

TLDR;

When launched from command line it starts multiple times. How to launch only once?

Here is the whole project available to reproduce the error GitHub whisper_standalone_cli

Details:

I am creating an executable from python code. I am able to successfully create the exec. And it does what it is supposed to do in one of the invocations. But there are further invocations as well. These are unwanted invocations and also these are started with incorrect arguments.

cli.py

if __name__ == '__main__':    startTime = time.time_ns()    print("cli started at :", startTime)    print("passed arguments:", sys.argv)    if sys.argv[1] != "-B":        cli()    print("cli returned which was started at :", startTime)    sys.exit()

logs

workspace % cli_exec testFile202312061352.mp4 --param1=False --param2=examplecli started at : 1703169729590419000passed arguments: ['cli_exec', 'testFile202312061352.mp4', '--param1=False', '--param2=example']cli started at : 1703169745011664000passed arguments: ['/Users/<machineUser>/cli_exec', '-B', '-S', '-I', '-c', 'from multiprocessing.resource_tracker import main;main(5)']cli returned which was started at : 1703169745011664000cli returned which was started at : 1703169729590419000multiprocessing/resource_tracker.py:104: UserWarning: resource_tracker: process died unexpectedly, relaunching.  Some resources might leak.workspace %  cli started at : 1703169816934835000passed arguments: ['/Users/<machineUser>/cliexec', '-B', '-S', '-I', '-c', 'from multiprocessing.resource_tracker import main;main(5)']cli returned which was started at : 1703169816934835000

Question

Can somebody please point out what am I doing wrong? Why it starts multiple times? Please note I run the command to launch only once. The next time workspace % appears it is because it is launched automatically.

For reference this is how I started make exec :

pyinstaller create standalone exec


Viewing all articles
Browse latest Browse all 23131

Trending Articles