ipython does not work with latest version of prompt-toolkit

Chris Warrick kwpolska at gmail.com
Sun Jun 3 05:49:00 EDT 2018


On Sun, 3 Jun 2018 at 10:32, Cecil Westerhof <Cecil at decebal.nl> wrote:
>
> When executing:
>     pip3 list --no-cache-dir --outdated
>
> I got:
>     prompt-toolkit 1.0.15    2.0.1    wheel
>     PyGObject      3.28.2    3.28.3   sdist
>     youtube-dl     2018.5.30 2018.6.2 wheel
>
> So I executed:
>     pip3 install --upgrade prompt-toolkit PyGObject youtube-dl
>
> This gave:
>     Successfully installed PyGObject-3.28.3 prompt-toolkit-2.0.1 youtube-dl-2018.6.2
>     ipython 6.4.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.1 which is incompatible.
>
> And when I now execute ipython3, I get:
>     Traceback (most recent call last):
>       File "/usr/local/bin/ipython3", line 7, in <module>
>         from IPython import start_ipython
>       File "/usr/local/lib/python3.5/dist-packages/IPython/__init__.py", line 55, in <module>
>         from .terminal.embed import embed
>       File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/embed.py", line 16, in <module>
>         from IPython.terminal.interactiveshell import TerminalInteractiveShell
>       File "/usr/local/lib/python3.5/dist-packages/IPython/terminal/interactiveshell.py", line 22, in <module>
>         from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output
>     ImportError: cannot import name 'create_prompt_application'
>
> When I now execute:
>     pip3 list --no-cache-dir --outdated
>
> I do not get output. So pip3 thinks everything is OK.
>
> How do I fix this? Or is the expected that ipython3 will be updated
> shortly?

Start by reading the warning from pip:

>     ipython 6.4.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.1 which is incompatible.

To fix this, downgrade prompt-toolkit. `pip list --outdated` (not)
having output isn’t a “good” or “bad” thing. prompt-toolkit v2 has
changed its API from v1, and ipython doesn’t support the new one yet.

Don’t randomly upgrade pip packages without knowing what the upgrade
entails, especially if the version changed from 1.x to 2.x (x.y →
x+1.y) — that usually means an API change and possible
incompatibilities in dependent packages. Upgrading a tool like
youtube-dl should be fine, and so should be a x.y.z → x.y.z+1 upgrade,
but it’s still best to know what you’re doing.

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16



More information about the Python-list mailing list