How can I fix the "ImportError: no module named shell" error for IPython

I have seen many people recommend using the following snippet to insert an IPython shell or go to an IPython shell, for example. kind of django.

from IPython.Shell import IPShellEmbed ipython = IPShellEmbed() ipython() 

But when I do this, I get

 >>> from IPython.Shell import IPShellEmbed Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named Shell 

How can I embed IPython or launch the IPython console from an existing python application?

+5
python ipython
source share
1 answer

The solution is to use the following instead :

 import IPython IPython.embed() 

Issue 286 in IPython github repo explains that Shell module has moved and will no longer be used .

+13
source share

All Articles