Skip to content

IPython beta: interactive matplotlib magic breaks terminal (Windows) #9652

Closed

Description

@jorisvandenbossche

When activating interactive figures with %matplotlib, and after plotting the first figure, the terminal does not capture any keyboard input anymore

In [6]: %matplotlib
Using matplotlib backend: Qt4Agg

In [7]: plt.plot([1,2,3])
Out[7]: [<matplotlib.lines.Line2D at 0xad116a0>]

After that, I cannot type or paste anything anymore, also not when the figure is closed. Something with the event loop?

I am working on Windows 7, and should be on master for both ipython and prompt toolkit.

Activity

  1. jorisvandenbossche commented on Jun 23, 2016

    @jorisvandenbossche
    ContributorAuthor

    This does not happen when I use %matplotlib tk, so only for the qt backend (and the others are not available on my Windows)

  2. Carreau commented on Jun 23, 2016

    @Carreau
    Member

    After that, I cannot type or paste anything anymore, also not when the figure is closed. Something with the event loop?

    Hum likely. I can't reproduce though on Mac OS. we will need someone on windows to help figure that out.

  3. added this to the 5.0 milestone on Jun 24, 2016
  4. takluyver commented on Jun 24, 2016

    @takluyver
    Member

    Thanks @jorisvandenbossche . The code for the Qt event loop is here:
    https://github.com/ipython/ipython/blob/master/IPython/terminal/pt_inputhooks/qt.py

    I'd guess that something to do with waiting for events on a file descriptor doesn't work on Windows; I know that select() on Windows only accepts sockets, not fds.

    I forget which input hooks I copied from ptpython, but if this is one, @jonathanslenders might be interested.

  5. jonathanslenders commented on Jun 24, 2016

    @jonathanslenders
    Contributor

    This one is not coming from ptpython.

    What we could do on Windows is using a separate thread to monitor the fd and quit the qt loop from there.

  6. modified the milestones: 5.0, 5.1 on Jul 5, 2016
  7. jorisvandenbossche commented on Jul 5, 2016

    @jorisvandenbossche
    ContributorAuthor

    @Carreau I noticed that you changed the milestone :-)
    I know at a certain point you have to tag a release, but IMO this one is rather critical (at least for me this is the reason I am currently not using the beta version anymore, plotting is rather critical in my interactive work).
    Is there anything I can do to help? (I have a windows, but not much knowledge about qt and event loops)

  8. modified the milestones: 5.0, 5.1 on Jul 5, 2016
  9. Carreau commented on Jul 5, 2016

    @Carreau
    Member

    Sorry about than, Min switched back the issue to 5.0.

  10. takluyver commented on Jul 5, 2016

    @takluyver
    Member

    @jorisvandenbossche when someone has attempted to fix this, it would be very useful if you could test the fix. I'll try to find time tomorrow if no-one beats me to it.

  11. Carreau commented on Jul 5, 2016

    @Carreau
    Member

    @jorisvandenbossche when someone has attempted to fix this, it would be very useful if you could test the fix. I'll try to find time tomorrow if no-one beats me to it.

    I already had pushed the rc1 this morning before this was reopened, and had to go offline. I'm back online. With the RC pushed, I'll announce it with this being the last blocking issue. Hopefully it might get some people to help with that.

  12. minrk commented on Jul 6, 2016

    @minrk
    Member

    Sorry, should have commented when I retargeted - I'm making some time to help with this one because I don't think we can do a release with matplotlib not working on Windows. Thanks for the two PRs, @Carreau!

    I can reliably reproduce this one, and #9705 does fix it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions