Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“我怎样才能解决问题?”;ImportError:没有名为shell的模块;IPython的错误_Python_Ipython - Fatal编程技术网

“我怎样才能解决问题?”;ImportError:没有名为shell的模块;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>"

我看到很多人建议我使用以下代码片段嵌入IPython外壳,或者从django视图中放入IPython外壳

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()