conda-forge / pyside2-feedstock

A conda-smithy repository for pyside2.
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

Issue with QOpenGLWidget and macOS arm64 pyside2 5.15.6, 5.15.5 binaries #142

Closed psobolewskiPhD closed 1 year ago

psobolewskiPhD commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

PySide2 macOS arm64 binary (tested 5.15.6, 5.15.5, on python 3.9 and python 3.10) appears to have a problem in the QOpenGLWidget. Specifically:

>>> from PySide2.QtWidgets import QOpenGLWidget
>>> hasattr(QOpenGLWidget, "defaultFramebufferObject")
False

This results in errors when using vispy and napari on arm64 with the PySide2 backend, see: https://github.com/vispy/vispy/issues/2406 https://github.com/napari/napari/issues/5231

Meanwhile, using x86 binary via rosetta:

>>> from PySide2.QtWidgets import QOpenGLWidget
>>> hasattr(QOpenGLWidget, "defaultFramebufferObject")
True

(this has been tested on linux (https://github.com/vispy/vispy/issues/2406#issuecomment-1282934307) and Intel Mac (https://github.com/napari/napari/issues/5231#issuecomment-1284445442) in both cases True is the output.)

To reproduce on arm64 macOS 12.6 using miniforge3:

mamba create -n pyside2 python=3.9 pyside2

Then in the python REPL:

from PySide2.QtWidgets import QOpenGLWidget
hasattr(QOpenGLWidget, "defaultFramebufferObject")

This should print True but will print False on arm64.

Installed packages

# packages in environment at /Users/piotrsobolewski/Dev/miniforge3/envs/pyside2:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.9.24            h4653dfc_0    conda-forge
gettext                   0.21.1               h0186832_0    conda-forge
giflib                    5.2.1                h27ca646_2    conda-forge
glib                      2.74.1               hb5ab8b9_0    conda-forge
glib-tools                2.74.1               hb5ab8b9_0    conda-forge
gst-plugins-base          1.20.3               h8b7775e_2    conda-forge
gstreamer                 1.20.3               hcb7b3dd_2    conda-forge
icu                       70.1                 h6b3803e_0    conda-forge
jpeg                      9e                   he4db4b2_2    conda-forge
krb5                      1.19.3               hf9b2bbe_0    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libclang                  14.0.6          default_h81a5282_0    conda-forge
libclang13                14.0.6          default_he70ec0d_0    conda-forge
libcxx                    14.0.6               h2692d47_0    conda-forge
libdeflate                1.14                 h1a8c8d9_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libglib                   2.74.1               h14ed1c1_0    conda-forge
libiconv                  1.17                 he4db4b2_0    conda-forge
libllvm14                 14.0.6               h37c5ba8_0    conda-forge
libogg                    1.3.4                h27ca646_1    conda-forge
libopus                   1.3.1                h27ca646_1    conda-forge
libpng                    1.6.38               h76d750c_0    conda-forge
libpq                     14.5                 h3f71257_1    conda-forge
libsqlite                 3.39.4               h76d750c_0    conda-forge
libtiff                   4.4.0                hfa0b094_4    conda-forge
libvorbis                 1.3.7                h9f76cd9_0    conda-forge
libwebp                   1.2.4                h328b37c_0    conda-forge
libwebp-base              1.2.4                h57fd34a_0    conda-forge
libxml2                   2.10.3               h87b0503_0    conda-forge
libxslt                   1.1.37               h1bd8bc4_0    conda-forge
libzlib                   1.2.13               h03a7124_4    conda-forge
mysql-common              8.0.31               hab468bb_0    conda-forge
mysql-libs                8.0.31               hea58576_0    conda-forge
ncurses                   6.3                  h07bb92c_1    conda-forge
nspr                      4.32                 hbdafb3b_1    conda-forge
nss                       3.78                 h1483a63_0    conda-forge
openssl                   1.1.1q               h03a7124_1    conda-forge
pcre2                     10.37                hcf5f1cc_1    conda-forge
pip                       22.3               pyhd8ed1ab_0    conda-forge
pyside2                   5.15.6           py39h0adaba8_3    conda-forge
python                    3.9.13          hc596b02_0_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
qt-main                   5.15.6               h96bf0dc_0    conda-forge
qt-webengine              5.15.4               h43c6231_3    conda-forge
readline                  8.1.2                h46ed386_0    conda-forge
setuptools                65.5.0             pyhd8ed1ab_0    conda-forge
sqlite                    3.39.4               h2229b38_0    conda-forge
tk                        8.6.12               he1e0b03_0    conda-forge
tzdata                    2022e                h191b570_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zstd                      1.5.2                h8128057_4    conda-forge

Environment info

active environment : pyside2
    active env location : /Users/piotrsobolewski/Dev/miniforge3/envs/pyside2
            shell level : 2
       user config file : /Users/piotrsobolewski/.condarc
 populated config files : /Users/piotrsobolewski/Dev/miniforge3/.condarc
                          /Users/piotrsobolewski/.condarc
          conda version : 4.13.0
    conda-build version : not installed
         python version : 3.10.2.final.0
       virtual packages : __osx=12.6=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/piotrsobolewski/Dev/miniforge3  (writable)
      conda av data dir : /Users/piotrsobolewski/Dev/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/piotrsobolewski/Dev/miniforge3/pkgs
                          /Users/piotrsobolewski/.conda/pkgs
       envs directories : /Users/piotrsobolewski/Dev/miniforge3/envs
                          /Users/piotrsobolewski/.conda/envs
               platform : osx-arm64
             user-agent : conda/4.13.0 requests/2.27.1 CPython/3.10.2 Darwin/21.6.0 OSX/12.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False
djhoese commented 1 year ago

I just had a thought @psobolewskiPhD, is there an older conda-forge build which has this class/module available? If so, maybe we can track this down to a specific build/PR in this feedstock that may be missing some build step.

psobolewskiPhD commented 1 year ago

@djhoese Good thought. I forgot to mention it here, but for arm64 macOS:

Executing the query pyside2

conda-forge/osx-arm64                              @   1.7MB/s  2.4s
conda-forge/noarch                                 @   2.9MB/s  3.8s

 Name    Version Build           Channel              
───────────────────────────────────────────────────────
 pyside2 5.15.6  py310h1ceb87a_0 conda-forge/osx-arm64
 pyside2 5.15.6  py310h1ceb87a_1 conda-forge/osx-arm64
 pyside2 5.15.6  py310h1ceb87a_2 conda-forge/osx-arm64
 pyside2 5.15.6  py310hbfa27b9_3 conda-forge/osx-arm64
 pyside2 5.15.6  py38h431e55d_3  conda-forge/osx-arm64
 pyside2 5.15.6  py38h9ecd3b8_0  conda-forge/osx-arm64
 pyside2 5.15.6  py38h9ecd3b8_1  conda-forge/osx-arm64
 pyside2 5.15.6  py38h9ecd3b8_2  conda-forge/osx-arm64
 pyside2 5.15.6  py39h0adaba8_3  conda-forge/osx-arm64
 pyside2 5.15.6  py39hf5e3978_0  conda-forge/osx-arm64
 pyside2 5.15.6  py39hf5e3978_1  conda-forge/osx-arm64
 pyside2 5.15.6  py39hf5e3978_2  conda-forge/osx-arm64
 pyside2 5.15.5  py310h5219f08_1 conda-forge/osx-arm64
 pyside2 5.15.5  py38h465b20c_1  conda-forge/osx-arm64
 pyside2 5.15.5  py39h46bc059_1  conda-forge/osx-arm64

I did check 5.15.5, python 3.9:

Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33) 
[Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide2.QtWidgets import QOpenGLWidget
>>> hasattr(QOpenGLWidget, "defaultFramebufferObject")
False

So same. Will update the OP.

jaimergp commented 1 year ago

@djhoese, just keeping you in the loop. We found out that this is not a conda-forge specific issue. The builds at homebrew also reproduce the error. See https://github.com/napari/packaging/issues/35#issuecomment-1307204473.

jschueller commented 1 year ago

goto https://bugreports.qt.io/browse/PYSIDE-2187

jschueller commented 1 year ago

should be fixed by #175, please test once merged and published

psobolewskiPhD commented 1 year ago

Wow! 🙏 ❤️