Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ipython does not work with latest version of prompt-toolkit

4,820 views
Skip to first unread message

Cecil Westerhof

unread,
Jun 3, 2018, 4:28:14 AM6/3/18
to
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?

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

Chris Warrick

unread,
Jun 3, 2018, 5:49:32 AM6/3/18
to
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

Cecil Westerhof

unread,
Jun 3, 2018, 6:59:14 AM6/3/18
to
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.

banerjee...@gmail.com

unread,
Dec 18, 2018, 3:55:59 AM12/18/18
to
I downgraded to the following versions and I go it working:
Python 3.6.5
jupyter 1.0.0
jupyter-client 5.2.3
jupyter-console 5.2.0
jupyter-core 4.4.0
ipython 6.4.0
prompt-toolkit to the version 1.0.15
0 new messages