Open ianozsvald opened 9 years ago
Thanks @ianozsvald for the extensive bug report!
This is a known issue: (See: https://github.com/jonathanslenders/python-prompt-toolkit/issues/63 ) I consider it serious, but it's hard to solve at the moment. prompt-toolkit has its own event loop, and IPython has an event loop. (Actually, I believe IPython patches stdin.) I have to find a way to integrate these two event loops.
Ah, it looks like a tricky one! Good luck with it
Thanks, @jonathanslenders!
Changed the backend to TkAgg
in matplotlibrc
and %matplotlib
in ptipython
works with no problems. More info on how to do that here.
Close this based on https://github.com/jonathanslenders/python-prompt-toolkit/issues/63?
It feels like the matplotlib integration (which runs in a separate event loop) is a bit broken by ptipython, this will probably be a problem for anyone using matplotlib.
I'm using Linux Mint 17.1 (Ubuntu 14.04), Python 3.4.2 (Anaconda), IPython 2.2.0, today's
<master>
for ptipython.If I run this in either ipython or ptipython, the plt.show() correctly causes a graph window to be drawn:
If the above (lines 2 & 3) are repeated in either ipython or ptipython, the graph will show again (so it feels like matplotlib integration is working in ptipython).
Note that in this mode (without using
%matplotlib
or passing in--pylab
) the.show()
is blocking.If I run a vanilla ipython (i.e.
$ ipython
, not$ ipython --pylab
), the%matplotlib
magic works and the event-loop is non-blocking. This is the usual interactive development process if you're working with charts:If I run the same using
$ ptipython
, I don't get a graph window. If I addplt.show()
then I also don't get a graph window. It looks like the matplotlib integration is a bit broken.Some (possibly unhelpful) notes:
I'll also note that autocompletion on e.g.
plt.plot(
gets slow, this is a Jedi problem (and Rope too) withmatplotlib
,scipy
etc and has been noted in e.g. the GVim forums. Somebody is bound to mention this soon so you ought to be aware of it.