升级Ipython时出现问题(prompt_toolkit不兼容)

时间:2018-09-28 09:04:44

标签: python ipython jupyter

尝试打开jupyter笔记本文件(.ipynb文件) 使用此命令ipython notebook filename.ipynb,然后在使用ipython时出现“ Below Error”。

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 个答案:

答案 0 :(得分:18)

遇到同样的问题。

对我来说,解决方案是pip uninstall prompt-toolkitpip install prompt-toolkit。这样就卸载了v1.0.5,并安装了v2.0.4。