Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPython gives error for unexpected keyword argument 'inputhook'

I installed Python 3 on a new Mac using Miniconda and have the following setup:

  • macOS Catalina 10.15.1
  • Conda 4.7.12
  • Python 3.7.5
  • iPython 7.9.0

When I try to run iPython in the terminal I receive the following error:

Traceback (most recent call last):
  File "/Users/g72/miniconda3/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/IPython/__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 663, in launch_instance
    app.initialize(argv)
  File "</Users/g72/miniconda3/lib/python3.7/site-packages/decorator.py:decorator-gen-113>", line 2, in initialize
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 317, in initialize
    self.init_shell()
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 333, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 464, in __init__
    self.init_prompt_toolkit_cli()
  File "/Users/g72/miniconda3/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 296, in init_prompt_toolkit_cli
    **self._extra_prompt_options())
TypeError: __init__() got an unexpected keyword argument 'inputhook'

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

The error appears to be related to an __init__() method keyword argument 'inputhook'. Any suggestions on how to fix this?

like image 571
wigging Avatar asked Dec 02 '19 17:12

wigging


1 Answers

It may be this issue, or a new related since it should be fixed: https://github.com/ipython/ipython/issues/11962

Downgrading prompt_toolkit worked for us: conda install prompt_toolkit==2.0.10

Edit: kmario23's response (upgrade IPython installation) is now preferable if possible!

like image 74
Fredrik Håård Avatar answered Oct 18 '22 11:10

Fredrik Håård