GUI written in python (with PyQT/PySide2) does not launch I just updated to Big Sur 11.2.1 and wanted to launch a python script that I wrote in a GUI with PySide2. When I launch the script, the terminals seems to be busy with the app:



However nothing more happens: the GUI doe not launch, there is no error message. and I have to kill manually the app. Here is the code
#!/usr/bin/python

# Import PySide classes
import sys
from PySide2.QtWidgets import *

# Create a Qt application
app = QApplication(sys.argv)
# Create a Label and show it
label = QLabel(&quot;Hello World&quot;)
label.show()
# Enter Qt application main loop
app.exec_()
sys.exit()


If a run the a script containing only print(&quot;hello&quot;) from the terminal, this works
Moreover in System Preferences &gt; Security &amp; Privacy &gt; Privacy &gt; Full Disk access, the app iTerm.app is selected (so iTerm.app should have permiession)
I just found the answer in this stackoverflow question. For some weird reason, one has to add the following piece of code at the beginning of the script.
import os
os.environ['QT_MAC_WANTS_LAYER'] = '1'


And that worked for me