You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really don't know if this is a but with the conda python.app package or with matplotlib.
When you run python.app/pythonw on Mac OS X and import pyplot, it launches the python.app app to the foreground, which steals the keyboard focus from the terminal. You can also reproduce this in IPython, which uses python.app (at least the conda version does).
Obviously I want any plot calls to call the plot to the foreground, but that it does this simply by importing pyplot is quite annoying (for instance, it often does it when I am running some tests).
Weirdly, I tried debugging the import with pudb, and it seems the app gets launched when the close function is defined
. That doesn't make any sense to me, but it does it consistently.
Also weirdly, when I tried to reproduce the bug with the git version, it didn't reproduce, even when I used the v3.0.0 version tag. My only guess is that somehow things compiled differently for me than they did for the conda package.
Code for reproduction
On macOS, run
pythonw
then run
importmatplotlib.pyplot
Actual outcome
The python.app launches and steals the keyboard focus.
Expected outcome
Either the app doesn't launch until a plot or show call is made, or it launches in the background (but an actual show call should launch it to the foreground and steal focus).
Matplotlib version
Operating system: macOS 10.12.6 (I also reproduced on Mojave)
Actually, I have just properly updated my installation of Matplotlib, and the issue seems to be fixed for me, so I suspect #12603 fixed it. Upgrading to version 3.0.1 should fix it - if it doesn't leave a comment here and we can re-open the bug 😄
Bug report
Bug summary
I really don't know if this is a but with the conda python.app package or with matplotlib.
When you run
python.app
/pythonw
on Mac OS X and import pyplot, it launches the python.app app to the foreground, which steals the keyboard focus from the terminal. You can also reproduce this in IPython, which uses python.app (at least the conda version does).Obviously I want any
plot
calls to call the plot to the foreground, but that it does this simply by importing pyplot is quite annoying (for instance, it often does it when I am running some tests).Weirdly, I tried debugging the import with pudb, and it seems the app gets launched when the
close
function is definedmatplotlib/lib/matplotlib/pyplot.py
Line 623 in 531bd02
Also weirdly, when I tried to reproduce the bug with the git version, it didn't reproduce, even when I used the v3.0.0 version tag. My only guess is that somehow things compiled differently for me than they did for the conda package.
Code for reproduction
On macOS, run
then run
Actual outcome
The
python.app
launches and steals the keyboard focus.Expected outcome
Either the app doesn't launch until a
plot
orshow
call is made, or it launches in the background (but an actualshow
call should launch it to the foreground and steal focus).Matplotlib version
print(matplotlib.get_backend())
): Qt5AggThe conda-forge
python.app
.The text was updated successfully, but these errors were encountered: