Incompatible Version of prompt-toolkit

The requirements.txt seems to bundle an incompatible version of prompt-toolkit so I face the following warning when I pip the requirements.txt file in the /mflix-python directory in mflix_venv named environment object.
ipython 7.2.0 has requirement prompt-toolkit<2.1.0,>=2.0.0, but you'll have prompt-toolkit 1.0.15 which is incompatible.

Not that I did not try ignoring it but I hit the dead end immediately after where I run jupyter notebook. I add the MongoClient.ipynb to the trust list and select a cell to execute it. The kernel starts but there is this yet another error as stated below where the kernel fails to restart due to the incomplete dependency of ipython which is in turn unsatisfied due to the incompatible version of prompt-toolkit.

Find the log of commands here :

I tried restarting the kernel from the provided button on the webpage but to no avail. This error practically does not let me try any command from the jupyter notebook server. Any help is appreciated.

[P.S. I am running Kubuntu 18.10 Cosmic Cuttlefish and have defaulted to Python 3.7. I have opted against using Anaconda by creating a virtual environment for this specific app.]

[EDIT : Just realised that the big block of command log might make the problem look daunting while maybe it is not. Cheers!]

@AkashdeepDhar, thanks for your help. I read your post. So how should we deal with the prompt-toolkit incompatibility?

The minor workaround that I am currently into is copying those code cells line-by-line and executing them on python3 shell. jupyter notebook server surely would have made it fast but there is no such downside that I have faced as of Lecture : Basic Reads of Chapter 1.

Sorry, when you say " copying those code cells line-by-line and executing them on python3 shell", which code cells do you mean?

Refer to the Lecture : MongoClient of Chapter 1. It asks you to host a jupyter notebook server locally for quick editing and execution of code cells. That seemingly fails as the kernel does not start up due to incompatible or missing dependencies.

Yes, the environment doesn’t work b/c the kernel immediately dies and won’t restart. So I abandoned the environment to try working on everything in my regular Jupyter env.

Is that the Jupyter imbibed withing Anaconda? You are lucky.

Yes, Jupyter comes bundled with Anaconda, at least with the full install.

I was currently having a hard time using python3 and python3-venv. Do you recommend installing Anaconda3 full package?

Definitely. It’s designed to all be compatible package versions.

1 Like

Also encountering this issue. Identical symptoms.

I am able to solve this problem by first uninstalling the prompt-toolkit and then installing it. This uninstalled the incompatible version (1.0.15 - which gets installed by requirements.txt) and installs the latest version, which works.

pip uninstall prompt-toolkit
Uninstalling prompt-toolkit-1.0.15:
Would remove:
Proceed (y/n)? y
Successfully uninstalled prompt-toolkit-1.0.15

pip install prompt-toolkit
Collecting prompt-toolkit
Downloading (337kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 337kB 2.8MB/s
Requirement already satisfied: six>=1.9.0 in c:\programdata\anaconda3\lib\site-packages (from prompt-toolkit) (1.12.0)
Requirement already satisfied: wcwidth in c:\programdata\anaconda3\lib\site-packages (from prompt-toolkit) (0.1.7)
jupyter-console 5.2.0 has requirement prompt-toolkit<2.0.0,>=1.0.0, but you’ll have prompt-toolkit 2.0.9 which is incompatible.
Installing collected packages: prompt-toolkit
Successfully installed prompt-toolkit-2.0.9