-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: Qt5Agg / PyQt5 not compatible with macOS Big Sur #18954
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
I assume that this is the upstream issue: https://bugreports.qt.io/browse/QTBUG-85546 I also posted to the PyQt5 mailing list about this. I'll update this if I get more information. |
I noticed that there is a StackOverflow post about this: After some investigation, it looks like importing
It looks like that's a compiled module, I'll see if it sets some system-level stuff to make itself work. Maybe that's what we need to do for PyQt5 on Big Sur... |
Actually importing
So I guess there is some magic in here? EDIT: I'm guessing it's the |
Based on seeing in one of the linked issues that the SDK will give conflicting answers based on who it thinks is asking. My guess is that loading tk forces the SDK in to "old" mode which gives back qt an answer that it likes. If that is the case so level of |
A suitable workaround seems to be |
Given that this seems to be generic to pyqt, I don't think we have to do anything about this right now, but leaving open as a signpost. |
I was also told on the PyQt5 mailing list that 5.15.2 will have this
Agreed it's not really matplotlib's problem. However, one option to try to save people some pain would be to add a |
I'm struggling to reproduce this issue. I have these versions installed:
and the following script is working fine for me, on macos 11.1: import matplotlib
matplotlib.use('QT5Agg')
import matplotlib.pyplot as plt
plt.figure()
plt.show() and just to be sure, I've checked that |
I never went as far back as 5.9 in the Qt versions. Doing some installs locally it looks like there is no problem on 5.11.3 (as far back as I could go with my Python 3.8 install using |
The conda packaged versions of Qt are getting painfully old these days... |
😆 well I seem to get a different error with 5.12.2 (will open a new issue), but I can confirm this with 5.15.1 |
Huh, now I've re-installed 5.12.2 it seems to be working fine. |
I think this is closed by #19334? If anyone disagrees please leave a comment or re-open. |
I have Qt5Agg set as my default backend. I recently upgraded my macOS system to Big Sur, and now import matplotlib.pyplot as plt; plt.figure() ends up hanging the interpreter. It seems like this is really a PyQt5 problem, but I thought I'd post some sort of information here as a bit of a warning for people, and as a place for people to mention workarounds if they have them. Or maybe I'm the only one with this problem, in which case sorry for the noise! FWIW I tried PyQt5 5.12 and 5.15.1, same problem on both. I also tried
pyside2
, it at least does not hang but no window is shown.In the meantime I'll probably set my backend to MacOSX.
EDIT: My
matplotlibrc
specifies bothbackend: Qt5Agg
andinteractive: True
The text was updated successfully, but these errors were encountered: