-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[Bug]: MacOSX - Show function triggering unwanted additional output #24997
Comments
Thank you for reporting this. It looks very much like a stack trace that is printed from an unhandled exception (i.e. when the program "crashes"). Although, it seems like the actual exception is missing and if I understand correctly, the program is working. We do test on MacOSX, but I am not sure which version, so it maybe related to 13.1. Several developers also use OSX, but, again, I am not aware of their OS version (but hope that they will clarify it, so I update the title a bit). A possible workaround for now is to use another backend (you seem to be using the macosx backend, as evident from the line starting with 13). Try something like:
(See https://matplotlib.org/stable/users/explain/backends.html for more info on backends.) Edit: it seems like all OSX tests are running on 12-series (although named |
On 13.1, I cannot replicate with
This is python 3.11.0, because that is what conda offers. |
@oscargus Thx for the explanation and the suggestion. You are right that I am using the When I change the backend to
|
Please try a Hello World using tk or pyqt5: https://www.geeksforgeeks.org/hello-world-in-tkinter/ If those have the same errors, this is at a lower level than Matplotlib |
@jklymak The following programs appear to work fine but I get the unwanted output with either of them. Any further suggestions? Program 1
Program 2
|
This means you cannot make any python GUIs show without this output, which means you have an install or library problem that we cannot help with. I would reinstall a fresh environment using conda, and get rid of the corrupt ones. I would not use the native python, nor one downloaded separately from conda. Finally, I should have specified above that I use the I'm going to close this, as this is not a Matplotlib bug. Feel free to follow up at https://discourse.matplotlib.org for more help on installation issues. |
I can replicate the problem with the exact above commands under macOS 13.1 and M1 Max processor getting:
|
Perhaps related to automatically hiding/showing menu bars? Can someone try to change that system setting and seeing if that changes anything? (I'm not able to reproduce either) We may need to handle this manually on our side and force the menubar to be hidden/shown? |
This workaround does indeed work for me. |
Originally posted by @greglucas in #24997 (comment)
My Mac's (Intel) systems settings under Desktop&Dock->Menu Bar for "Automatically hide and show the menu bar" has been set at This helps me isolate the problem but does not solve it because I like to keep the menu bar hidden. @jklymak Would you still think this is a library or installation problem? Can you also reproduce the problem now? Thx. |
If PyQT errors and Tk Errors, then I don't think there is much we can do and this should be reported to those projects. If it is the MacOSX backend, we may be able to do something. |
I think this needs to be fixed upstream actually since it is happening in every backend. I'm not sure what we can do after looking into it a bit. |
Upgraded macOS to 13.2 from 13.1 today. Similar unwanted output continues to come out when the Python code in my original poster is run via the macOS command line interface (the Terminal app) and the aforementioned macOS menu bar setting is at |
It looks like this is a bug on Apple's end. We can't really fix it. Feel free to request a re-open if there is something we can do. |
It seems fixed on Ventura 13.3. |
Bug summary
The matplotlib.pyplot.show function leads to some unwanted output which is about 30 or so lines of text when included in any of my Python programs and run under the macOS (Ventura 13.1) command line interface with the following command (suppose name of the program is
test.py
)or through Visual Studio Code.
Other than the unwanted output, the programs work correctly including any chart or charts triggered by the show function. When I remove the show function from the program and run it again, the unwanted output disappears but then the chart is not displayed as well.
The unwanted output does not appear when the same program is run using IDLE, Python’s Integrated Development and Learning Environment, or the code in it from within a Jupyter notebook in Visual Studio Code.
Code for reproduction
Actual outcome
I am pasting below only the unwanted output which comes out at the same time the chart is displayed. The simple chart produced by the program comes out as expected otherwise.
Expected outcome
None of this unwanted output should appear.
Additional information
There is nothing in the code that should cause the unwanted output under normal conditions. I have started having this issue after upgrading macOS from Monterey 12.6.1 to Ventura 13.1. Under macOS Ventura 13.1, I have tried Python 3.10.4 and 3.11.1 along with Matplotlib 3.5.2 and 3.6.2 and keep getting the same unwanted output.
Operating system
macOS 13.1
Matplotlib Version
3.6.2
Matplotlib Backend
MacOSX
Python version
3.11.1
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: