Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lawbyte opened this issue Jun 27, 2021 · 8 comments
Open

Comments

@lawbyte
Copy link

lawbyte commented Jun 27, 2021

➜ 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'

@sbower
Copy link

sbower commented Jul 11, 2021

I'm getting the same issue

@eljeffeg
Copy link
Contributor

eljeffeg commented Jul 31, 2021

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
Copy link
Contributor

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

@ghost
Copy link

ghost commented Aug 30, 2021

I am experiencing the same issue.

1 similar comment
@levelnoah
Copy link

I am experiencing the same issue.

@hax3xploit
Copy link

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

This will FIX your problem.

@levelnoah
Copy link

levelnoah commented Sep 14, 2021 via email

eljeffeg added a commit to eljeffeg/katana that referenced this issue Sep 14, 2021
Update Katana for changes in cmd2 >= 2.0 (June 2021)
@eljeffeg
Copy link
Contributor

eljeffeg commented Sep 14, 2021

Excellent - thanks for identifying the issue. Since we now know the cause, I created a pull request that doesn't require a cmd2 downgrade. #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants