question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prompt-toolkit requirement conflict

See original GitHub issue

jupyter requires jupyter-console and ipykernel. jupyter-console==5.2.0 (the most recent) requires prompt-toolkit<2.0.0, but ipykernel==5.0.0 (the most recent) requires prompt-toolkit>=2.0.0. prompt-toolkit-1.0.15 ends up being installed, which results in

>python -c "import ipykernel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "...\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "...\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "...\lib\site-packages\IPython\__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "...\lib\site-packages\IPython\terminal\embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "...\lib\site-packages\IPython\terminal\interactiveshell.py", line 20, in <module>
    from prompt_toolkit.formatted_text import PygmentsTokens
ImportError: No module named 'prompt_toolkit.formatted_text'

This occurs when doing pip install jupyter, in Python 3.5. It is triggered by the new release of ipykernel 5.0.0.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:30
  • Comments:10

github_iconTop GitHub Comments

57reactions
saubhikcommented, Oct 1, 2018

I had to do the following:

pip uninstall ipython pip install ipython==6.5.0

ipython==6.5.0 works with prompt-toolkit-1.0.15 which gets installed when you do pip install jupyter.

20reactions
raunaks13commented, Sep 30, 2018

The problem is with the recent ipykernel update. A temporary fix could be:

pip uninstall ipykernel pip install ipykernel==4.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asking for input (prompts) - Python Prompt Toolkit 3.0
The reason for this is that the up and down key bindings would conflict otherwise. ... If however, Vi binding are required, just...
Read more >
Problems upgrading Ipython (prompt_toolkit incompatibilities)
There appears to be a conflict in dependencies in different parts of the jupyter install. We may have to wait a day or...
Read more >
python-prompt-toolkit.pdf - Read the Docs
prompt_toolkit is a library for building powerful interactive command line and terminal applications in Python. It can be a very advanced pure ...
Read more >
ipython does not work with latest version of prompt-toolkit
pip3 install --upgrade prompt-toolkit PyGObject youtube-dl. This gave: ... ipython 6.4.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, ... is a conflict.
Read more >
Incompatible Version of prompt-toolkit - M220P - MongoDB
The requirements.txt seems to bundle an incompatible version of prompt-toolkit so I face the following warning when I pip the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found