pyinstaller: error: unrecognized arguments: B:/coding/py2exe/test.py

103 views
Skip to first unread message

Galaxy Gamer YT

unread,
Sep 23, 2023, 3:55:29 PM9/23/23
to PyInstaller
I am using the PyInstaller module in my python code. I have the module running this command:

--onefile --clean --distpath B:\\coding\\py2exe --workpath B:\\coding\\py2exe\\temp_build_folder --specpath B:\\coding\\py2exe\\temp_spec_folder --noconfirm -c B:/coding/py2exe/test.py

Code:

PyInstaller.__main__.run([
'--onefile',
'--clean',
'--distpath B:\\coding\\py2exe',
'--workpath B:\\coding\\py2exe\\temp_build_folder',
'--specpath B:\\coding\\py2exe\\temp_spec_folder',
'--noconfirm',
'-c',
'B:/coding/py2exe/test.py'
]

I don't know where I'm going wrong.
Can anyone help thx.

bwoodsend

unread,
Sep 24, 2023, 4:59:39 AM9/24/23
to PyInstaller

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 B:\coding\py2exe" "--workpath B:\coding\py2exe\temp_build_folder" "--specpath B:\\coding\\py2exe\\temp_spec_folder" --noconfirm -c B:/coding/py2exe/test.py

which is not valid.

Galaxy Gamer YT

unread,
Sep 27, 2023, 2:48:54 AM9/27/23
to PyInstaller
Perfect thank you.
Reply all
Reply to author
Forward
0 new messages