16
votes

Trying to open a jupyter notebook file (.ipynb file) with this command ipython notebook filename.ipynb then I am getting Below Error while using ipython..

Traceback (most recent call last):
File "c:\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python\Scripts\ipython.exe\__main__.py", line 5, in <module>
File "c:\python\lib\site-packages\IPython\__init__.py", line 55, in <module>
from .terminal.embed import embed
File "c:\python\lib\site-packages\IPython\terminal\embed.py", line 16, in 
<module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "c:\python\lib\site-packages\IPython\terminal\interactiveshell.py", 
line 18, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
ModuleNotFoundError: No module named 'prompt_toolkit'
1
try install prompt toolkit pip install prompt_toolkit - ikuamike
Done and i got this message but the issue is not resolved -> Requirement already satisfied: prompt_toolkit in /home/chirag/miniconda3/lib/python3.7/site-packages (1.0.15) Requirement already satisfied: wcwidth in /home/chirag/miniconda3/lib/python3.7/site-packages (from prompt_toolkit) (0.1.7) Requirement already satisfied: six>=1.9.0 in /home/chirag/miniconda3/lib/python3.7/site-packages (from prompt_toolkit) (1.11.0) - Chirag Rajpurohit
This is a valid ipython error report. Others of us have encountered this. It should be reopened. But it's probably better reported as a ipython/jupyter bug. - hpaulj
A relevant bug issue: github.com/jupyter/jupyter/issues/370. There appears to be a conflict in dependencies in different parts of the jupyter install. We may have to wait a day or two for it to be straightened out. - hpaulj
For now I've got a cleaner install using ipython==6.5 rather than the latest. - hpaulj

1 Answers

40
votes

Just got the same problem.

The solution for me was to pip uninstall prompt-toolkit and pip install prompt-toolkit. This uninstalled v1.0.5 and installed v2.0.4.