SOLVED: figures from ipython within emacs on Windows

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171211/448f351f/attachment.html>

Great to hear that you got this sorted out!

Tom

···

On Mon, Dec 11, 2017, 12:36 Strozzi, David J. <strozzi2 at llnl.gov> 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
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171215/af7305b2/attachment.html>