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

☆樱花仙子☆ 提交于 2021-01-26 03:58:33

问题


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:

  1. Remove PySide2/shiboken2

    pip3 uninstall PySide2

    pip3 uninstall shiboken2

  2. Reinstall

    pip3 install PySide2



来源:https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!