Skip to content

IPython terminal issue with Qt4Agg on XP SP3 #481

Closed

Description

@klonuo

If matplotlib backend in 'matplotlibrc' is set to Qt4Agg, terminal console mode slows down on multiple levels: there is pause on every letter entered; if I paste some code I have to wait approx 1sec for every 2-3 characters!; and overall it seems so unnaturally slow. This does not happen however in IPython qtconsole, and I don't remember similar behavior when I used 10.2 on Windows 7. This also does not happen if matplotlib backend is set to WXAgg for example.

Noticed on:

Windows XP SP3 32 bit
Python 2.6.6 (official from python.org)
PyQt4 4.8.4
matplotlib 1.0.1
IPython 0.11.dev

Activity

  1. fperez commented on May 29, 2011

    @fperez
    Member

    I'm marking this as critical for 0.11 so that at least we check (I can do it) if one of us can reproduce it. If this is systemic, it will make 0.11 unusable on Windows with Qt.

  2. ghost assigned on May 29, 2011
  3. jstenar commented on Jun 22, 2011

    @jstenar
    Contributor

    I can reproduce this problem on windows 7 64-bit.
    python2.6.6 (32bit)
    pyqt4 v4.8.3
    matplotlib 1.0.1
    ipython 0.11.dev master 1144388

    However it is not a problem in the qtconsole

    It does not behave like this with the tk-backend

    /Jörgen

  4. fperez commented on Jun 22, 2011

    @fperez
    Member

    @epatters, this looks pretty nasty. Do you have any inkling as to what could be going on? I had the impression you'd been testing with Windows a while ago, so I imagined you'd have seen this already.

    It definitely is not a problem in Linux, so somehow it must be something with Qt on Windows. I wonder if it's a Qt 4.8 problem, I think when we did the original work we were testing (I also did some light Windows testing at the time) with Qt 4.6 or 4.7...

  5. fperez commented on Jun 22, 2011

    @fperez
    Member

    @epatters, btw, I just realized my previous message makes it sound like I'm blaming you, which is not the case :) Just looking for your input/wisdom...

  6. epatters commented on Jun 23, 2011

    @epatters
    Contributor

    I've been using PySide on Windows, which means that I can't use matplotlib's Qt backend. In other words, I haven't tried this out lately. When I have access to my Windows box tomorrow, I will switch back to PyQt4 and see if I can debug the problem.

    Off the top of my head, though, the behavior described above also occurs when running a PDB session under vanilla Python if QtCore.pyqtRemoveInputHook() has not been called. For more information, see:

    http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/python_shell.html

    Perhaps something is not playing nice with PyQt4's input hook...

  7. jstenar commented on Jun 23, 2011

    @jstenar
    Contributor

    fperez skrev 2011-06-23 00:25:

    @epatters, this looks pretty nasty. Do you have any inkling as to what could be going on? I had the impression you'd been testing with Windows a while ago, so I imagined you'd have seen this already.

    It definitely is not a problem in Linux, so somehow it must be something with Qt on Windows. I wonder if it's a Qt 4.8 problem, I think when we did the original work we were testing (I also did some light Windows testing at the time) with Qt 4.6 or 4.7...

    I tried to run without pyreadline and then it behaves normally. So there
    seems to be some kind of interaction between pyreadline and Qt4.

    Unfortunately I'm leaving for a short midsummer holiday and will be back
    on sunday evening.

    /Jörgen

  8. fperez commented on Jun 23, 2011

    @fperez
    Member

    On Thu, Jun 23, 2011 at 1:30 AM, jstenar
    reply@reply.github.com
    wrote:

    I tried to run without pyreadline and then it behaves normally. So there
    seems to be some kind of interaction between pyreadline and Qt4.

    Thanks for the feedback though, this is already useful.

    Have a good wekend!

    f

  9. klonuo commented on Jun 24, 2011

    @klonuo
    ContributorAuthor

    Feel free to contact me with instructions if you don't have Windows XP/7 PC. I have both with IPython 0.11dev

    Cheers

  10. klonuo commented on Jun 24, 2011

    @klonuo
    ContributorAuthor

    Well, I have no idea how I closed this issue as I only commented

    huh

  11. epatters commented on Jun 24, 2011

    @epatters
    Contributor

    The "Comment and Close" button is dangerously close to the "Comment" button. Not a great usability decision there...

  12. minrk commented on Jun 24, 2011

    @minrk
    Member

    That's true. I use dotjs (Userscripts/greasemonkey would work too) to float it to the left and fade it a little, so I don't click it accidentally:

    function leftClose(){
        // float 'Comment & Close' button on the left, to prevent accidental clicking
        // also fade text to grey to make it stand out less
        // query from from userscripts.org/scripts/105325
        var andClose = document.querySelector('button[name="comment_and_close"]');
        if (andClose){
            // float it on the left
            andClose.style.float='left';
            // fade text
            andClose.style.color="#aaa";
            // or you can just remove the button altogether:
            // andClose.parentNode.removeChild(andClose);
        }
    }
    leftClose();

    This is what it looks like to me:

  13. epatters commented on Jun 24, 2011

    @epatters
    Contributor

    Nice one! Thanks.

  14. 43 remaining items

  15. rkern commented on Dec 6, 2011

    @rkern
    Contributor

    For what it's worth, an EPD customer has seen similar problems on Windows XP with the WXAgg backend to matplotlib. Changing the inputhook constants do not seem to make any noticeable difference. I have not been able to replicate the wx slowness myself on Windows 7 (I can replicate the Qt slowness, though).

  16. SirVer commented on Dec 24, 2011

    @SirVer

    sorry for the late feedback, I was travelling and didn't bother doing my email. Yes, I can also see the problem just with using --gui qt.

  17. Proletariat99 commented on Apr 15, 2012

    @Proletariat99

    Here is a VERY simple newbie solution for someone brand new to python/iPython that may work for some of you newbies like me:

    Here's my version info:

    • Python 2.7.2 -- EPD_free 7.2-2 (32-bit)
    • ipython --version 0.12
    • matplotlib 1.1.0
    • numpy 1.7.0
    • scipy 0.11.0 maybe?

    I just created a new profile using the startup option '' and that seemed to do the trick. Utterly newb solution, but it worked for me and may work for you.

    For you seasoned devs, here's some info that may help:

    Before I found the hidden nanolink at Enthought, I struggled with the install for quite a while. After attempting to install manually a variety of ways, I think I had a very confused python install. I'm guessing that I had something in there that called a problematic input hook that was causing the problem. I wasn't able to find anything, but I honestly didn't look that hard yet.

    Here are just a few of the misguided things I did while trying to install:

    • gcc manual install (was trying to avoid xcode - failed - no compiler)
    • clang install (failed)
      • llvm manual install (clang dependency)
        • freetype2 manual install (llvm dependency)
    • Finally gave in to xcode install (hate xcode -- big, closed, clunky)
    • Heard "Enthought" enough to realize they HAD to have a free link somewhere that had Numpy/Scipy/Matplotlib as a free package. Went back and scoured their site until I found it.

    So then I finally created a new profile and it fixed the super slowness.

    Hope that helps someone, somewhere.

    Cheers.

  18. takluyver commented on Apr 15, 2012

    @takluyver
    Member

    So does that mean that, on a Mac, simply creating a profile solved the
    unresponsiveness issue for you? That's a bit odd, because when you
    create a profile, it just writes files with all the settings commented
    out. But it might give someone something to work with. Thanks, Dave.

  19. fperez commented on Jun 11, 2012

    @fperez
    Member

    I'm sorry to do this, but I'm downgrading this to 'high' priority from 'blocker', simply because we can't realistically block the entire release on an issue we have no clue how to fix.

    It's a real bummer, and I hope we'll be able to track what's going on at some point, but absent any progress, we can't stall a release on this. And in fact, we were violating the 'blocker' marker already since we'd bumped this from 0.11 to 0.12 to 0.13, so if anything I'm just being upfront about what we've already done.

  20. indiajoe commented on Feb 7, 2013

    @indiajoe

    I would like to report that i have been facing this problem for a long time in my gnu/linux too. Surprised to see it has been reported only in Windows.


    In short following are the specifications:
    Linux Kernel : 3.5.2
    Distro: Porteus ( https://en.wikipedia.org/wiki/Porteus_%28operating_system%29 )
    Desktop: Trinity (aka. fork of KDE 3.5 )
    Python version : 2.6.4
    IPython version : 0.12
    I run Ipython in terminal by the simple "ipython" command. (no extra arguments)


    Description of problem:
    This usually happens when i leave Ipython terminal open for a few days.
    I typically have the numpy, scipy and matplotlib modules loaded.
    The machine doesnot gets slow. Infact the commands run by Ipython are also not slow.
    Only the keyboard input is slow.
    Even if I copy-paste some content into Ipython, it prints each pasted letter one by one with a uniform delay.
    While this pasted content is being printed slowly on screen or when i use backspace to remove it, we can see the CPU percentage use of Ipython shooting significantly up in htop.
    If I exit the session, and start again, everything works fine as usual.


  21. oliford commented on May 17, 2013

    @oliford

    I and my office mate both see this bug in linux too. So here's our experiences, in case it helps isolate it:

    I'm using XUbuntu 12.04 (Xfce), ipython 0.12.1 and my office mate also on Linux Mint with ipython 13.1-rc2.
    We both see it slowing only the keyboard input (including just moving the cursor) and pasting after use of matplotlib and numpy for some time. I do also use scipy but my officemate doesn't. We're both using the GTKAgg backend.

    It doesn't occur immediately, but after some time with use of plotting etc.
    We both see significant disk activity during moving the cursor back and forth (as in #1184, perhaps I should have posted this there? I don't want to double post though).

  22. oliford commented on May 17, 2013

    @oliford

    I've found that our problem is exactly that in matplotlib/matplotlib#1530 relating to writing .local/share/recently-used.xbel after opening the GTK (maybe also Qt) save figure dialog once (but not necessarily saving anything). I'll wander over there now.

  23. danielballan commented on Jun 11, 2013

    @danielballan
    Contributor

    I have the same experience as @oliford on Ubuntu 12.04, iPython 0.14.dev, GTKAgg.

  24. danielballan commented on Jun 11, 2013

    @danielballan
    Contributor

    One man's testimonial: I resolved this issue by installing the dev version of matplotlib. Perhaps this commit in this issue cited by @oliford did the trick.

  25. minrk commented on Jul 6, 2013

    @minrk
    Member

    Based on @danielballan's feedback, I would be inclined to close.

  26. ivanov commented on Jul 17, 2013

    @ivanov
    Member

    closing based on the conversation around matplotlib/matplotlib#1530.

  27. added a commit that references this issue on Nov 3, 2014
    7ed81f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions