It worked for me in the cmd.exe console:
C:\tools\python2-x86_32\Scripts\pyinstaller.exe --name="Name app" --onefile --windowed --icon=tk.ico script.py
But I need to compile python
This does not work:
subprocess.call(['C:\tools\python2-x86_32\Scripts\pyinstaller.exe ','--name','Name app','--onefile ','--windowed','--icon=','tk.ico','script.py'])
Traceback (most recent call last): File "C:/Users/usercom/Documents/sql_alpha/sqlms.py", line 96, in <module> subprocess.call(['C:\tools\python2-x86_32\Scripts\pyinstaller.exe','--name','Analysis log Pre-Alpha 1','--onefile ','--windowed','--icon=','tk.ico','tk.py']) File "C:\tools\python2-x86_32\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\tools\python2-x86_32\lib\subprocess.py", line 710, in init errread, errwrite) File "C:\tools\python2-x86_32\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2]
This does not work:
cmd = 'C:\tools\python2-x86_32\Scripts\pyinstaller.exe --name="Name app" --onefile --windowed --icon=tk.ico script.py'
subprocess.Popen(cmd, stdout=subprocess.PIPE)
> Traceback (most recent call last): File "C:/Users/usercom/Documents/sql_alpha/sqlms.py", line 97, in <module> subprocess.Popen(cmd, stdout=subprocess.PIPE) File "C:\tools\python2-x86_32\lib\subprocess.py", line 710, in __init__ errread, errwrite) File "C:\tools\python2-x86_32\lib\subprocess.py", line 958, in _execute_child startupinfo)
WindowsError: [Error 5]
How to make it work?
'Name app'with'"Name app"'- Tarun Behalcmd = r'C:\tools\python2-x86_32\Scripts\pyinstaller.exe --name="Name app" --onefile --windowed --icon=tk.ico script.py'. The string literal'\t'is a tab character if you don't use a raw string. - Eryk Sun