Skip to content

TypeError: __init__() got an unexpected keyword argument 'inputhook' #11962

Closed

Description

@nschloe

I updated all my Python packages this morning and IPython doesn't work anymore since then. Error:

Traceback (most recent call last):
  File "/home/nschloe/.local/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
  File "/home/nschloe/.local/lib/python3.7/site-packages/IPython/__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 663, in launch_instance
    app.initialize(argv)
  File "</home/nschloe/.local/lib/python3.7/site-packages/decorator.py:decorator-gen-113>", line 2, in initialize
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/nschloe/.local/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 317, in initialize
    self.init_shell()
  File "/home/nschloe/.local/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 "/usr/lib/python3/dist-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/home/nschloe/.local/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 464, in __init__
    self.init_prompt_toolkit_cli()
  File "/home/nschloe/.local/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 ipython-dev@python.org

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

Activity

  1. oboudry commented on Nov 25, 2019

    @oboudry

    I just reinstalled jupyterlab using conda conda install -c conda-forge jupyterlab and am getting the exact same error when running ipython.

  2. Carreau commented on Nov 25, 2019

    @Carreau
    Member

    Downgrade prompt_toolkit ? Seem like Prompt toolkit 3.0 was released yesterday.

  3. sgjholt commented on Nov 25, 2019

    @sgjholt

    @Carreau @nschloe Can confirm that downgrading to prompt_toolkit 2.0 solved the issue. I had exactly the same error installing a fresh version of iPython via anaconda.

  4. Carreau commented on Nov 25, 2019

    @Carreau
    Member

    our setup.py already state that we are only compatible with prompt toolkit version 2. I'll check the conda recipe.

  5. pinned this issue on Nov 25, 2019
  6. Carreau commented on Nov 25, 2019

    @Carreau
    Member

    Conda-forge should be updated to tell it that the latest IPython is not compatible with ptk 3.

    Though the solver may still get you an older version of IPython w/ a new version of prompt toolkit.

  7. Carreau commented on Nov 26, 2019

    @Carreau
    Member

    Master is compatible with PTK3 if necessary.

  8. suewonjp commented on Nov 28, 2019

    @suewonjp

    This same issue occurred when I used ipdb (version 0.12.2) on Windows Subsystem for Linux 1 with python 3.6.9.
    I downgraded ipython to 7.9.0 and it worked fine.
    I think ipdb doesn't work with ipython 7.10.0.

  9. jplana commented on Nov 28, 2019

    @jplana

    Had the same error today after a fresh ipdb install. Downgraded prompt_toolkit to 2.0.10, now it works fine.

  10. added a commit that references this issue on Nov 30, 2019
    f52ca01
  11. Carreau commented on Nov 30, 2019

    @Carreau
    Member

    for the ipdb issue please try #11979 I'll try to make a 7.10.1 on monday.

  12. added this to the 7.10 milestone on Nov 30, 2019
  13. snowman commented on Dec 3, 2019

    @snowman

    downgrade prompt_toolkit package

    # --upgrade option can be used as downgrade also ;)
    $ pip3 install --upgrade --user prompt_toolkit==2.0.10
  14. lijunzh commented on Dec 3, 2019

    @lijunzh

    downgrade prompt_toolkit package

    In conda use the following command to downgrade:

    conda install prompt_toolkit==2.0.10
    
  15. Carreau commented on Dec 4, 2019

    @Carreau
    Member

    7.10.1 should have been released; you can also upgrade IPython.

    Also when downgrading use <, so that if there is a patch or minor release you can get it.

    $ pip3 install --upgrade --user 'prompt_toolkit<3'
    
  16. locked as off topic and limited conversation to collaborators on Dec 4, 2019
  17. unpinned this issue on Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions