Is there any solution regarding to PyQt library doesn't work in Mac OS Big Sur?

Viewed 5041

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?

4 Answers

Adding os.environ['QT_MAC_WANTS_LAYER'] = '1' fixes the issue on PyQT 5.15.1 (credits)

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

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.

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:

  1. Remove PySide2/shiboken2

    pip3 uninstall PySide2

    pip3 uninstall shiboken2

  2. Reinstall

    pip3 install PySide2

Related