“我怎样才能解决问题?”;ImportError:没有名为shell的模块;IPython的错误
我看到很多人建议我使用以下代码片段嵌入IPython外壳,或者从django视图中放入IPython外壳“我怎样才能解决问题?”;ImportError:没有名为shell的模块;IPython的错误,python,ipython,Python,Ipython,我看到很多人建议我使用以下代码片段嵌入IPython外壳,或者从django视图中放入IPython外壳 from IPython.Shell import IPShellEmbed ipython = IPShellEmbed() ipython() 但当我这么做的时候,我会 >>> from IPython.Shell import IPShellEmbed Traceback (most recent call last): File "<stdin>"
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
>>来自IPython.Shell导入ipshell嵌入
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为Shell的模块
如何从现有python应用程序嵌入IPython或启动IPython控制台?解决方案是:
在上,解释Shell模块已经移动并且应该移动。感谢取消对该问题的否决投票的人;有些人似乎没有意识到,您可以在shell配置文件中添加别名,
alias'ipython'='python-m ipython'
import IPython
IPython.embed()