我见过很多人建议我使用以下代码片段来嵌入IPython shell或者从例如IPhthon shell中删除IPython shell。 django观点。
from IPython.Shell import IPShellEmbed
ipython = IPShellEmbed()
ipython()
但是当我这样做时,我得到了
>>> from IPython.Shell import IPShellEmbed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Shell
如何从现有的python应用程序中嵌入IPython或启动IPython控制台?
答案 0 :(得分:13)
解决方法是改为use the following:
import IPython
IPython.embed()
Issue 286上的IPython github repo解释说Shell模块已移动,应该no longer be used。