SOLVED: figures from ipython within emacs on Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SOLVED: figures from ipython within emacs on Windows

dstrozzi

Hi,

 

This is an issue I bugged several people / lists about previously, which has a solution.  Thought I’d share it.

 

I am running the GNU Win32 native build of emacs (ver. 25.3), on Windows 7 (not a cygwin or X11 version).  I’m one of those “emacs is an operating system” people, and like running Python shells within emacs.  The problem was getting matplotlib figures to work – the figure window would either say “not responding”, not render, freeze, or somehow misbehave.

 

Someone involved in the elpy package (for python on emacs) gave the following solution, which works for me using the TkAgg or Qt5Agg backends: use jupyter console instead of ipython.  The whole thing is murky to me, but I thought that nowadays ipython is the Python-specific “piece” / interface to jupyter console.  Either way, it seems like jupyter console just gives me ipython, but apparently in a way that the event loop or whatever with figure windows is “happy”.

 

So Add this to your .emacs:

(setq python-shell-interpreter "jupyter"

      python-shell-interpreter-args "console --simple-prompt")

(setq python-shell-completion-native-enable nil)

 

Then M-x run-python, then pylab, then figure(1) etc. and it should work.

 

Hope this helps more people use emacs as their Windows Python IDE.

 

Dave


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SOLVED: figures from ipython within emacs on Windows

tcaswell

Great to hear that you got this sorted out!

Tom


On Mon, Dec 11, 2017, 12:36 Strozzi, David J. <[hidden email]> wrote:

Hi,

 

This is an issue I bugged several people / lists about previously, which has a solution.  Thought I’d share it.

 

I am running the GNU Win32 native build of emacs (ver. 25.3), on Windows 7 (not a cygwin or X11 version).  I’m one of those “emacs is an operating system” people, and like running Python shells within emacs.  The problem was getting matplotlib figures to work – the figure window would either say “not responding”, not render, freeze, or somehow misbehave.

 

Someone involved in the elpy package (for python on emacs) gave the following solution, which works for me using the TkAgg or Qt5Agg backends: use jupyter console instead of ipython.  The whole thing is murky to me, but I thought that nowadays ipython is the Python-specific “piece” / interface to jupyter console.  Either way, it seems like jupyter console just gives me ipython, but apparently in a way that the event loop or whatever with figure windows is “happy”.

 

So Add this to your .emacs:

(setq python-shell-interpreter "jupyter"

      python-shell-interpreter-args "console --simple-prompt")

(setq python-shell-completion-native-enable nil)

 

Then M-x run-python, then pylab, then figure(1) etc. and it should work.

 

Hope this helps more people use emacs as their Windows Python IDE.

 

Dave

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users