katana icon indicating copy to clipboard operation
katana copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'choices_method'

Open lawbyte opened this issue 3 years ago • 8 comments

➜ katana git:(master) katana Traceback (most recent call last): File "/usr/local/bin/katana", line 11, in load_entry_point('katana==2.0', 'console_scripts', 'katana')() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/main.py", line 10, in from katana.repl import Repl, ReplMonitor File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/repl/init.py", line 301, in class Repl(cmd2.Cmd): File "/usr/local/lib/python3.8/dist-packages/katana-2.0-py3.8.egg/katana/repl/init.py", line 587, in Repl monitor_remove_parser.add_argument( File "/usr/local/lib/python3.8/dist-packages/cmd2-2.1.1-py3.8.egg/cmd2/argparse_custom.py", line 562, in _add_argument_wrapper new_arg = orig_actions_container_add_argument(self, *args, **kwargs) File "/usr/lib/python3.8/argparse.py", line 1380, in add_argument action = action_class(**kwargs) TypeError: init() got an unexpected keyword argument 'choices_method'

lawbyte avatar Jun 27 '21 05:06 lawbyte

I'm getting the same issue

sbower avatar Jul 11 '21 05:07 sbower

Me too, not sure choices_method is a valid add_argument. I think it should probably be choices? https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument

eljeffeg avatar Jul 31 '21 15:07 eljeffeg

I even get this choices_method error in Docker. I'll also note that to get docker to install, I had to replace libenchant-dev with libenchant-2-dev as libenchant-dev could not be found.

Screen Shot 2021-08-23 at 8 12 12 PM

eljeffeg avatar Aug 24 '21 00:08 eljeffeg

I am experiencing the same issue.

ghost avatar Aug 30 '21 00:08 ghost

I am experiencing the same issue.

levelnoah avatar Aug 31 '21 12:08 levelnoah

1. pip uninstall cmd2
2. pip install cmd2=='1.0.1'

This will FIX your problem.

hax3xploit avatar Sep 14 '21 05:09 hax3xploit

Thank you very much for the reply It's working. Later i will post this solution to your github Issues because some other people are having this problem

发自我的iPhone

------------------ Original ------------------ From: Abdullah Khawaja @.> Date: Tue,Sep 14,2021 1:20 PM To: JohnHammond/katana @.> Cc: levelnoah @.>, Comment @.> Subject: Re: [JohnHammond/katana] TypeError: init() got an unexpected keyword argument 'choices_method' (#33)

  1. pip uninstall cmd2 2. pip install cmd2=='1.0.1'
    This will FIX your problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

levelnoah avatar Sep 14 '21 05:09 levelnoah

Excellent - thanks for identifying the issue. Since we now know the cause, I created a pull request that doesn't require a cmd2 downgrade. https://github.com/JohnHammond/katana/pull/39

Note: If the PR is accepted, existing users that update Katana may need to update cmd2 or they'll get a similar error, TypeError: __init__() got an unexpected keyword argument 'choices_provider'. pip install cmd2 --upgrade

eljeffeg avatar Sep 14 '21 13:09 eljeffeg