It’s your dist/work/spec path parameters causing the problem. They need to
be written as either '--distpath=B:\\coding\\py2exe' or two separate
strings '--distpath', 'B:\\coding\\py2exe'. The command line equivalent of
your current Python code is
pyinstaller --onefile --clean "--distpath
I’ve read some about how sys.executable() is different when you run a
packaged application, so I’m sure that could be playing a role, but I have
no idea how to fix that.
A library that tries to run Python subprocesses will cause a PyInstaller
application to keep spawning itself because