-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matplotlib macosx windows don't respond in qtconsole #640
Comments
Are you using |
Using: ipython qtconsole --pylab Then in the qt console: x = r_[0:2*pi:100j] A new figure appears in an osx window (using osx backend) but no events work on it (can't close, resize, use bottom toolbar, etc). |
hm, what version of matplotlib? I'm using master, and it's perfectly responsive. |
I'm using enthought's latest distribution which has MPL 1.0.1 along with ipython 0.11rc1 (which I updated to rc4). I also can't use pylab=qt because it complains I don't have PyQt4. |
The pylab=qt was a typo, should have been pylab=osx. I am using matplotlib master, but I will try to check out 1.0.1, and |
I upgraded to 0.11, still using standard Enthought install otherwise and still the osx backend is not responding. |
And now I've just compiled the master branch of matplotlib (1.1.0) and it still doesn't work. Doesn't seem to be an MPL thing. BTW, i'm on Lion. Any more debugging I can try? |
Hm, this is troubling. I, too, am running Lion and the OSX backend with the qtconsole with some regularity. There's some chance that it's EPD that's causing the trouble, but I don't see how. Can you post some of the startup output of I think this behavior is exactly what happens when you use the OSX backend without launching IPython in pylab-mode, but I'm not sure how that would be happening. |
How's this? blackbear:~$ ipython qtconsole --debug --pylab [IPKernelApp] {'parent_header': {u'date': datetime.datetime(2011, 8, 1, 14, 51, 40, 647485), u'username': u'claumann', u'session': u'08e5b0cf-676f-4117-971d-ba1d617e4126', u'msg_id': u'95cdc6d3-55f2-491a-b60f-059da79bfdea', u'msg_type': u'execute_request'}, 'msg_type': u'execute_reply', 'msg_id': '52b14acd-6e15-47f9-b13f-c62ff64d0718', 'content': {u'status': u'ok', 'execution_count': 0, u'payload': [], u'user_expressions': {}, u'user_variables': {}}, 'header': {'date': datetime.datetime(2011, 8, 1, 14, 51, 41, 850532), 'username': u'kernel', 'session': '0cf962ba-777b-4bc0-be61-e8d3c407bb94', 'msg_id': '52b14acd-6e15-47f9-b13f-c62ff64d0718', 'msg_type': u'execute_reply'}, 'tracker': None} Next line is absolutely enormous. On Aug 1, 2011, at 1:28 PM, minrk wrote:
|
I have the same issue.
I'm running Leopard (10.5) on a ppc machine. What system are you running claumann? edit: choosing backend = TkAgg or Qt4Agg in the matplotlibrc file solved the problem, ipython qtconsole works fine after that |
I'm running on Lion with a recent (one year old) intel macbook pro. Basic python world provided by Enthought 7.1-1 (64-bit). I just updated to the master ipython from github and it still doesn't work with the osx backend. Haven't been able to use any others -- I don't have Qt4 or wxPython installed and using --pylab=tk crashes the kernel after drawing the window for the plot. (with the error message alloc: invalid block: 0x105d3efc0: 47 0) |
Also, using the html notebook with --pylab=osx backend has the exact same problem of non-responsive plotting windows. |
@claumann it makes sense that the behavior is the same between the qtconsole and notebook, as they use the same kernel code (where all the real execution happens). I typically use matplotlib trunk, which is generally better behaved (much less crashy with the osx backend), but I just installed the 1.0.1 egg from sourceforge, and it still behaves just fine, so I'm baffled. At some point, I will try installing EPD, and see if it behaves any differently. You might try getting the eggs from the scipy superpack, and see if they don't work better. So: System Python (2.7 on Lion and 2.6 on SL) + git numpy + matplotlib (1.0.1 or trunk) definitely work fine here. |
I've looked into this a bit, and it does seem to be unique to EPD. It at least does not affect System Python, and shouldn't affect any official Python.org distros, but it will affect any Python that is built against non-native libtk (could include macports). I had forgotten that selecting the OSX backend uses the Tk version of the kernel in order to get the zmq polling integrated with the backend eventloop. Using Tk works fine with the system Python because the system Tk is native Cocoa, so the CFRunLoop (the native eventloop) that the osx backend hooks into is that of the Tk app, and events are processed properly. However, EPD's Tk is bizarrely linked against X11 instead of native libraries, so it doesn't advance the CFRunLoop. This explains why the behavior in EPD is the same as if the backend eventloop is not hooked up - it isn't. I certainly don't blame EPD for shipping their own Tk - the system one is notoriously a mess - but that is the root cause of this issue. So, essentially we need to figure out a different way to get the CFRunLoop going without using Tk, since Tk can't be assumed to be using the native toolkit. Any matplotlib and/or Mac folks have clever ideas for how to integrate with the native eventloop when stdin doesn't exist? |
via matplotlib.backend_macosx.TimerMac, rather than Tk Fallback on Tk if matplotlib is < 1.1.0, which introduces the necessary Timer. This means that it still won't work on current EPD, which has X11-linked libtk and matplotlib 1.0.1, but at least it will display a warning explaining why. also remove caveat in docs that qtconsole doesn't work with native MacOSX, since it does on normal (non-EPD) installs. So this will work in more places, but still not in most common failure case (stock EPD) described in ipython#640.
closed by #809. There is still no way to run |
via matplotlib.backend_macosx.TimerMac, rather than Tk Fallback on Tk if matplotlib is < 1.1.0, which introduces the necessary Timer. This means that it still won't work on current EPD, which has X11-linked libtk and matplotlib 1.0.1, but at least it will display a warning explaining why. also remove caveat in docs that qtconsole doesn't work with native MacOSX, since it does on normal (non-EPD) installs. So this will work in more places, but still not in most common failure case (stock EPD) described in ipython#640.
Running 0.11 rc1 and rc4, I can use the osx backend to plot (in new figure windows) but the windows do not respond to mouse clicks or any gui events. Is this my fault or something to be fixed?
The text was updated successfully, but these errors were encountered: