A blog about SQL Server, SSIS, C# and whatever else I happen to be dealing with in my professional life.

Find ramblings

Monday, August 28, 2017

Python pyinstaller erroring with takes 4 positional arguments but 5 were given

Pyinstaller is a program for turning python files into executable programs. This is helpful as it removes the requirement for having the python interpreter installed on a target computer. What was really weird was I could generate a multi-file package (pyinstaller .\MyFile.py) but not a onefile version.

C:\tmp>pyinstaller -onefile .\MyFile.py

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35-32\Scripts\pyinstaller-script.py", line 9, in 
    load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')()
  File "c:\program files (x86)\python35-32\lib\site-packages\PyInstaller\__main__.py", line 73, in run
    args = parser.parse_args(pyi_args)
  File "c:\program files (x86)\python35-32\lib\argparse.py", line 1727, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "c:\program files (x86)\python35-32\lib\argparse.py", line 1759, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "c:\program files (x86)\python35-32\lib\argparse.py", line 1967, in _parse_known_args
    start_index = consume_optional(start_index)
  File "c:\program files (x86)\python35-32\lib\argparse.py", line 1907, in consume_optional
    take_action(action, args, option_string)
  File "c:\program files (x86)\python35-32\lib\argparse.py", line 1835, in take_action
    action(self, namespace, argument_values, option_string)
TypeError: __call__() takes 4 positional arguments but 5 were given

What's the root cause? The argument is --onefile not -onefile.

No comments: