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 'inputhook' #11962

Closed
nschloe opened this issue Nov 25, 2019 · 12 comments · Fixed by #11979
Closed

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

nschloe opened this issue Nov 25, 2019 · 12 comments · Fixed by #11979
Milestone

Comments

@nschloe
Copy link

nschloe commented Nov 25, 2019

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
@oboudry
Copy link

oboudry commented Nov 25, 2019

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

@Carreau
Copy link
Member

Carreau commented Nov 25, 2019

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

@sgjholt
Copy link

sgjholt commented Nov 25, 2019

@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.

@Carreau
Copy link
Member

Carreau commented Nov 25, 2019

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

@Carreau Carreau pinned this issue Nov 25, 2019
@Carreau
Copy link
Member

Carreau commented Nov 25, 2019

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.

@Carreau
Copy link
Member

Carreau commented Nov 26, 2019

Master is compatible with PTK3 if necessary.

@suewonjp
Copy link

suewonjp commented Nov 28, 2019

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.

@jplana
Copy link

jplana commented Nov 28, 2019

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

@Carreau
Copy link
Member

Carreau commented Nov 30, 2019

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

@snowman
Copy link

snowman commented Dec 3, 2019

downgrade prompt_toolkit package

# --upgrade option can be used as downgrade also ;)
$ pip3 install --upgrade --user prompt_toolkit==2.0.10

@lijunzh
Copy link

lijunzh commented Dec 3, 2019

downgrade prompt_toolkit package

In conda use the following command to downgrade:

conda install prompt_toolkit==2.0.10

@Carreau
Copy link
Member

Carreau commented Dec 4, 2019

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'

@ipython ipython locked as off-topic and limited conversation to collaborators Dec 4, 2019
@Carreau Carreau unpinned this issue Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants