-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
No keyboard focus in figures on macOS with Anaconda #9839
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
Comments
Update: This only happens when using the (default) |
Are you using the framework build of python? (ie. are you starting python using |
No. It works with |
Here is a magic incantation to get |
Nice, thanks @jklymak this works! I wish Anaconda made |
Ha ha. I think there are a few threads about it.... I don't understand the issue, but, I don't use ipython except via jupyter notebooks, so... |
On 2017/11/23 9:19 PM, Clemens Brunner wrote:
Nice, thanks @jklymak <https://github.com/jklymak> this works! I wish
Anaconda made |pythonw| the default for everything to avoid these kinds
of tricks. Has anyone ever asked them why they don't want to play nice
with macOS frameworks?
|
OMG what's the tl;dr? I assume not much has happened. This is the one reason why I can't recommend Anaconda on macOS without any reservations. |
There is an open issue: ContinuumIO/anaconda-issues#199 |
if you want more bedtime reading ;-) |
On 2017/11/24 9:55 AM, Clemens Brunner wrote:
OMG what's the tl;dr? I assume not much has happened. This is the one
reason why I can't recommend Anaconda on macOS without any reservations.
Right, no resolution or improvement that I know of. For matplotlib, it
just means it is easiest to use the qt5agg backend instead of the macosx
backend. The qt5agg backend has more features and gets more development
anyway. The Anaconda limitation is annoying, but I wouldn't let it
block a recommendation to use Anaconda on OS X.
|
You're right, but the problem with this is that osx is the default backend. If it wasn't this wouldn't be such a big issue. Anaconda could probably change the default to qt5 because PyQt5 gets installed anyway. |
#9795 will make it easier to configure the "default" on a user-by-user basis... |
I thought qt5 was the default on osx with conda....Did that change recently? |
[I just checked by installing from defaults (version 2.0.2) and from conda-forge (version 2.1.0), and in both cases the backend default is qt5agg.] This is with Python 3.6. |
How did you check this? When I start IPython in Anaconda, I get:
Also, |
@cbrnr, thanks for keeping after this--I wasn't being careful enough. It turns out I didn't check something that I thought I had checked, and the upshot is that my backend was being set from my own matplotlibrc file, not from the one installed by conda. Side note: it's far from obvious, but to find out which matplotlibrc file is being used one can call |
So what's the plan? The best solution would be if Anaconda defaulted their Python executables to a framework build (something everyone else is doing, seems to have no negative side effects and makes Python run smoothly on macOS). Alternatively, as a workaround, they could change the default matplotlib backend to |
I tried, but cloning stalls after an hour or so, so I can't test with this PR. However, I noticed that my example from my initial post does work in Anaconda now. Unless I create a new env, I then get a segfault. So I'm not sure what's wrong with Anaconda on my machine, I never seem to get it to work properly. |
@cbrnr, thanks! Keep us informed if possible. |
I tested with the latest Anaconda packages and this issue has been resolved. Thanks! |
Using Python installed via Anaconda on macOS, figures do not receive keyboard focus. All key presses go to the terminal instead.
Minimal example:
The same thing happens when listening to key press events - they are simply not detected at all.
Using Python installed via Homebrew doesn't have this problem. There are some reports regarding this behavior (#665, #2120, #3367, #4372), but I still run into this issue. I'm using the latest Anaconda packages and tried the latest Matplotlib release and latest development version.
The text was updated successfully, but these errors were encountered: