Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython - "cannot import name 'create_prompt_application' from 'prompt_toolkit.shortcuts'

I'm trying to get ipython working on my windows 10 64 bit computer. When I try to start ipython from the command line, I get the error pictured in the screenshot attached to this question.

Has anyone encountered this? How I might I fix this problem?

Ipython Error

like image 634
GeneralPancake Avatar asked Aug 03 '18 16:08

GeneralPancake


1 Answers

This problem is caused by having a newer version of Prompt Toolkit installed than is depended upon by IPython. (Version 2.0.4 of Prompt Toolkit is installed and IPython requires version 1.0.15.)

You can rectify this issue by installing an older, compatible version of prompt-toolkit with pip (or pip3):

pip3 install 'prompt-toolkit<2.0.0,>=1.0.15' --force-reinstall 

(If you install or upgrade Prompt Toolkit past 1.0.15—the last 1.x version—you will receive a warning from pip: ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.4 which is incompatible.)

like image 116
dotism Avatar answered Oct 06 '22 04:10

dotism