cannot import name 'interactiveshell' from 'IPython.core.interactiveshell'

问题遇到的现象和发生背景

jupyter 上想运行代码
from IPython.core.interactiveshell import interactiveshell
InteractiveShell.ast_node_interactivity = 'all',然后报错

问题相关代码,请勿粘贴截图

img

classIPython.core.interactiveshell.InteractiveShell(**kwargs),应该是InteractiveShell,注意i和s两个字母是大写。

from IPython.core.interactiveshell import InteractiveShell

如对你有帮助,请点击采纳按钮。