ipython does not work with latest version of prompt-toolkit

Cecil Westerhof Cecil at decebal.nl
Sun Jun 3 06:58:14 EDT 2018


Chris Warrick <kwpolska at gmail.com> writes:

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

I did not find a command to get all the existing versions. I solved it
with uninstalling and then installing with:
    pip3 install 'prompt-toolkit>=1.0.15,<2.0.0'

Is there a way to find the versions? It would be handy to install the
1.0.16 version if it comes out.


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

Always checking would be a lot of work: I get several times a week
several packages to update. If I would check them all I need a few
hours more a week. I am used to systems that do not update when there
is a conflict. But sadly pip does not work that way. :'-(

But I could do the 'automatic' update only when x does not change. Or
for specific packages like youtube-dl.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list