问题
I've done some project using PyQt library for my class assignmnet. And I need to check my application working before I submit it.
Today, 3 hours ago I updated my Mac book OS to Big Sur. And I found out that PyQt library doesn't work. It doesn't show any GUI.
Are there someone know how to fix it?
回答1:
Adding os.environ['QT_MAC_WANTS_LAYER'] = '1' fixes the issue on PyQT 5.15.1 (credits)
回答2:
Rolling back to PyQt5==5.13.0 fixed the issue for me! you should uninstall PyQt5 and then install it using pip install PyQt5==5.13.0
回答3:
It could be related to this.
If it is, then disconnecting from the internet would fix it.
As would redirecting ocsp.apple.com to 0.0.0.0 in /etc/hosts.
回答4:
Related to this, after upgrading to BigSur my app stopped launching its window...I am using the official Qt supported binding PySide2/shiboken2
Upgrading from PySide2 5.12 to 5.15 fixed the issue.
Steps:
Remove PySide2/shiboken2
pip3 uninstall PySide2pip3 uninstall shiboken2Reinstall
pip3 install PySide2
来源:https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur