PyQt5 and Big Sur

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

PyQt5 and Big Sur

Eric Larson
I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my matplotlib backend. Opening a matploltlib figure in interactive mode now causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello world example causes the interpreter to hang.

I tried the same matplotlib code with pyside2, and there at least the interpreter would not hang. For both PyQt5 and pyside2, however, no window actually showed up, even though an icon did appear. So it seems at least some of this is probably a problem at the level of Qt rather than PyQt5.

Should I just watch this upstream issue?


Eric

Reply | Threaded
Open this post in threaded view
|

Re: PyQt5 and Big Sur

Jeremy Katz


On 15/Nov/20 04:50, Eric Larson wrote:

> I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my
> matplotlib backend. Opening a matploltlib figure in interactive mode now
> causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello
> world <https://pythonprogramminglanguage.com/pyqt5-hello-world/> example
> causes the interpreter to hang.
>
> I tried the same matplotlib code with pyside2, and there at least the
> interpreter would not hang. For both PyQt5 and pyside2, however, no
> window actually showed up, even though an icon did appear. So it seems
> at least some of this is probably a problem at the level of Qt rather
> than PyQt5.
I had an apparent application hang with PyQt and Qt 5.15.0, and an
application bundle created with PyInstaller. Dtruss revealed that the
application was executing, but very slowly. IIRC, the main window went
from displaying in ~5 seconds with macOS Catalina to 4 minutes with Big Sur.

Running the application once with "open -F" seemed to resolve the issue
permanently.


OpenPGP_0x095F4F2148BF111D.asc (1K) Download Attachment
OpenPGP_signature (505 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PyQt5 and Big Sur

Marius Shekow
Hi, I also found that setting the environment variable
QT_MAC_WANTS_LAYER to "1" fixes the problem, as per
https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur/64856281

No idea, why it works, but it's a good workaround for your early adoper
users who accuse you, the app developer, to have "broken everything".
Shame on me... (sarcasm).

Am 15.11.2020 um 23:35 schrieb Jeremy Katz:

>
> On 15/Nov/20 04:50, Eric Larson wrote:
>> I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my
>> matplotlib backend. Opening a matploltlib figure in interactive mode now
>> causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello
>> world <https://pythonprogramminglanguage.com/pyqt5-hello-world/> example
>> causes the interpreter to hang.
>>
>> I tried the same matplotlib code with pyside2, and there at least the
>> interpreter would not hang. For both PyQt5 and pyside2, however, no
>> window actually showed up, even though an icon did appear. So it seems
>> at least some of this is probably a problem at the level of Qt rather
>> than PyQt5.
> I had an apparent application hang with PyQt and Qt 5.15.0, and an
> application bundle created with PyInstaller. Dtruss revealed that the
> application was executing, but very slowly. IIRC, the main window went
> from displaying in ~5 seconds with macOS Catalina to 4 minutes with Big Sur.
>
> Running the application once with "open -F" seemed to resolve the issue
> permanently.
>
--
Dr. Marius Shekow
Mixed and Augmented Reality Solutions, Fraunhofer FIT
http://www.fit.fraunhofer.de/mars
Tel.: +49(0)2241 - 14-3555

Reply | Threaded
Open this post in threaded view
|

Re: PyQt5 and Big Sur

Eric Larson
Beautiful, QT_MAC_WANTS_LAYER=1 works for me!

Eric


On Tue, Nov 17, 2020 at 8:33 AM Marius Shekow <[hidden email]> wrote:
Hi, I also found that setting the environment variable
QT_MAC_WANTS_LAYER to "1" fixes the problem, as per
https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur/64856281

No idea, why it works, but it's a good workaround for your early adoper
users who accuse you, the app developer, to have "broken everything".
Shame on me... (sarcasm).

Am 15.11.2020 um 23:35 schrieb Jeremy Katz:
>
> On 15/Nov/20 04:50, Eric Larson wrote:
>> I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my
>> matplotlib backend. Opening a matploltlib figure in interactive mode now
>> causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello
>> world <https://pythonprogramminglanguage.com/pyqt5-hello-world/> example
>> causes the interpreter to hang.
>>
>> I tried the same matplotlib code with pyside2, and there at least the
>> interpreter would not hang. For both PyQt5 and pyside2, however, no
>> window actually showed up, even though an icon did appear. So it seems
>> at least some of this is probably a problem at the level of Qt rather
>> than PyQt5.
> I had an apparent application hang with PyQt and Qt 5.15.0, and an
> application bundle created with PyInstaller. Dtruss revealed that the
> application was executing, but very slowly. IIRC, the main window went
> from displaying in ~5 seconds with macOS Catalina to 4 minutes with Big Sur.
>
> Running the application once with "open -F" seemed to resolve the issue
> permanently.
>
--
Dr. Marius Shekow
Mixed and Augmented Reality Solutions, Fraunhofer FIT
http://www.fit.fraunhofer.de/mars
Tel.: +49(0)2241 - 14-3555

Reply | Threaded
Open this post in threaded view
|

Re: PyQt5 and Big Sur

Phil Thompson-5
Note that PyQt v5.15.2 will set this automatically.

Phil

On 17/11/2020 14:16, Eric Larson wrote:

> Beautiful, QT_MAC_WANTS_LAYER=1 works for me!
>
> Eric
>
>
> On Tue, Nov 17, 2020 at 8:33 AM Marius Shekow <
> [hidden email]> wrote:
>
>> Hi, I also found that setting the environment variable
>> QT_MAC_WANTS_LAYER to "1" fixes the problem, as per
>>
>> https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur/64856281
>>
>> No idea, why it works, but it's a good workaround for your early
>> adoper
>> users who accuse you, the app developer, to have "broken everything".
>> Shame on me... (sarcasm).
>>
>> Am 15.11.2020 um 23:35 schrieb Jeremy Katz:
>> >
>> > On 15/Nov/20 04:50, Eric Larson wrote:
>> >> I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my
>> >> matplotlib backend. Opening a matploltlib figure in interactive mode now
>> >> causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello
>> >> world <https://pythonprogramminglanguage.com/pyqt5-hello-world/>
>> example
>> >> causes the interpreter to hang.
>> >>
>> >> I tried the same matplotlib code with pyside2, and there at least the
>> >> interpreter would not hang. For both PyQt5 and pyside2, however, no
>> >> window actually showed up, even though an icon did appear. So it seems
>> >> at least some of this is probably a problem at the level of Qt rather
>> >> than PyQt5.
>> > I had an apparent application hang with PyQt and Qt 5.15.0, and an
>> > application bundle created with PyInstaller. Dtruss revealed that the
>> > application was executing, but very slowly. IIRC, the main window went
>> > from displaying in ~5 seconds with macOS Catalina to 4 minutes with Big
>> Sur.
>> >
>> > Running the application once with "open -F" seemed to resolve the issue
>> > permanently.
>> >
>> --
>> Dr. Marius Shekow
>> Mixed and Augmented Reality Solutions, Fraunhofer FIT
>> http://www.fit.fraunhofer.de/mars
>> Tel.: +49(0)2241 - 14-3555
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: PyQt5 and Big Sur

Thomas Caswell
Great, thank you for your work Phil!

Tom

On Tue, Nov 17, 2020, 11:33 Phil Thompson <[hidden email]> wrote:
Note that PyQt v5.15.2 will set this automatically.

Phil

On 17/11/2020 14:16, Eric Larson wrote:
> Beautiful, QT_MAC_WANTS_LAYER=1 works for me!
>
> Eric
>
>
> On Tue, Nov 17, 2020 at 8:33 AM Marius Shekow <
> [hidden email]> wrote:
>
>> Hi, I also found that setting the environment variable
>> QT_MAC_WANTS_LAYER to "1" fixes the problem, as per
>>
>> https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur/64856281
>>
>> No idea, why it works, but it's a good workaround for your early
>> adoper
>> users who accuse you, the app developer, to have "broken everything".
>> Shame on me... (sarcasm).
>>
>> Am 15.11.2020 um 23:35 schrieb Jeremy Katz:
>> >
>> > On 15/Nov/20 04:50, Eric Larson wrote:
>> >> I recently updated to Big Sur (11.0.1). I have Qt5Agg set as my
>> >> matplotlib backend. Opening a matploltlib figure in interactive mode now
>> >> causes the interpreter to hang on 5.12 and 5.15.1. Even running a hello
>> >> world <https://pythonprogramminglanguage.com/pyqt5-hello-world/>
>> example
>> >> causes the interpreter to hang.
>> >>
>> >> I tried the same matplotlib code with pyside2, and there at least the
>> >> interpreter would not hang. For both PyQt5 and pyside2, however, no
>> >> window actually showed up, even though an icon did appear. So it seems
>> >> at least some of this is probably a problem at the level of Qt rather
>> >> than PyQt5.
>> > I had an apparent application hang with PyQt and Qt 5.15.0, and an
>> > application bundle created with PyInstaller. Dtruss revealed that the
>> > application was executing, but very slowly. IIRC, the main window went
>> > from displaying in ~5 seconds with macOS Catalina to 4 minutes with Big
>> Sur.
>> >
>> > Running the application once with "open -F" seemed to resolve the issue
>> > permanently.
>> >
>> --
>> Dr. Marius Shekow
>> Mixed and Augmented Reality Solutions, Fraunhofer FIT
>> http://www.fit.fraunhofer.de/mars
>> Tel.: +49(0)2241 - 14-3555
>>
>>