conda-forge / pyside2-feedstock

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

Different behavior between conda- and pip-installed PySide6 #164

Closed hoechenberger closed 1 year ago

hoechenberger commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Trying to run the following MWE succeeds when installing PySide6 from PyPI via pip, but fails with the version from conda-forge:

from PySide6.QtCore import Qt
Qt.CTRL | Qt.Key_Y

Reproducible MWE via PyPI package (works):

❯ mamba create -y -n test python
❯ mamba run -n test pip install pyside6
❯ mamba run -n test python -c "from PySide6.QtCore import Qt; Qt.CTRL | Qt.Key_Y"

Reproducible MWE via conda-forge package (fails):

❯ mamba create -y -n test python pyside6=6.4.1
❯ mamba run -n test python -c "from PySide6.QtCore import Qt; Qt.CTRL | Qt.Key_Y"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'Modifier' and 'Key'

ERROR conda.cli.main_run:execute(49): `conda run python -c from PySide6.QtCore import Qt; Qt.CTRL | Qt.Key_Y` failed. (See above for error)

How can this be?

Installed packages

mamba list for PyPI-based installation:

# packages in environment at /Users/hoechenberger/mambaforge/envs/test:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libzlib                   1.2.13               h03a7124_4    conda-forge
ncurses                   6.3                  h07bb92c_1    conda-forge
openssl                   3.0.7                h03a7124_1    conda-forge
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
pyside6                   6.4.1                    pypi_0    pypi
pyside6-addons            6.4.1                    pypi_0    pypi
pyside6-essentials        6.4.1                    pypi_0    pypi
python                    3.11.0          h93c2e33_0_cpython    conda-forge
readline                  8.1.2                h46ed386_0    conda-forge
setuptools                65.5.1             pyhd8ed1ab_0    conda-forge
shiboken6                 6.4.1                    pypi_0    pypi
tk                        8.6.12               he1e0b03_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge

mamba list for conda-forge-based installation:

# packages in environment at /Users/hoechenberger/mambaforge/envs/test:
#
# Name                    Version                   Build  Channel
assimp                    5.2.3                hd77be17_1    conda-forge
boost-cpp                 1.74.0               h1cb353e_8    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
cairo                     1.16.0            h73a0509_1014    conda-forge
double-conversion         3.2.0                hb7217d7_1    conda-forge
expat                     2.5.0                hb7217d7_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.1               h82840c6_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               hd633e50_1    conda-forge
gettext                   0.21.1               h0186832_0    conda-forge
glib                      2.74.1               hb5ab8b9_0    conda-forge
glib-tools                2.74.1               hb5ab8b9_0    conda-forge
graphite2                 1.3.13            h9f76cd9_1001    conda-forge
gst-plugins-base          1.20.3               h8b7775e_2    conda-forge
gstreamer                 1.20.3               hcb7b3dd_2    conda-forge
harfbuzz                  5.3.0                hddbc195_0    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                  13.0.1          default_h2cfa9b4_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
libllvm13                 13.0.1               hfd59cb2_2    conda-forge
libogg                    1.3.4                h27ca646_1    conda-forge
libopus                   1.3.1                h27ca646_1    conda-forge
libpng                    1.6.39               h76d750c_0    conda-forge
libpq                     14.5                 hb650857_3    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libtiff                   4.4.0                hfa0b094_4    conda-forge
libvorbis                 1.3.7                h9f76cd9_0    conda-forge
libwebp-base              1.2.4                h57fd34a_0    conda-forge
libxml2                   2.9.14               h9d8dfc2_4    conda-forge
libxslt                   1.1.35               ha8fb468_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
openssl                   1.1.1s               h03a7124_1    conda-forge
pcre2                     10.37                hcf5f1cc_1    conda-forge
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h27ca646_0    conda-forge
pyside6                   6.4.1           py310h6bbb1e2_0    conda-forge
python                    3.10.8          hf452327_0_cpython    conda-forge
python_abi                3.10                    3_cp310    conda-forge
qt6-main                  6.4.0                h4be6a9e_3    conda-forge
readline                  8.1.2                h46ed386_0    conda-forge
setuptools                65.5.1             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               he1e0b03_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zlib                      1.2.13               h03a7124_4    conda-forge
zstd                      1.5.2                h8128057_4    conda-forge

Environment info

❯ mamba info

     active environment : base
    active env location : /Users/hoechenberger/mambaforge
            shell level : 1
       user config file : /Users/hoechenberger/.condarc
 populated config files : /Users/hoechenberger/mambaforge/.condarc
                          /Users/hoechenberger/.condarc
          conda version : 4.13.0
    conda-build version : not installed
         python version : 3.10.4.final.0
       virtual packages : __osx=13.1=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/hoechenberger/mambaforge  (writable)
      conda av data dir : /Users/hoechenberger/mambaforge/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/hoechenberger/mambaforge/pkgs
                          /Users/hoechenberger/.conda/pkgs
       envs directories : /Users/hoechenberger/mambaforge/envs
                          /Users/hoechenberger/.conda/envs
               platform : osx-arm64
             user-agent : conda/4.13.0 requests/2.27.1 CPython/3.10.4 Darwin/22.2.0 OSX/13.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False
hoechenberger commented 1 year ago

Hello, I'm still seeing this issue with the latest builds, and I'm very much at a loss as to what's going on :( This problem makes it impossible for me to use a package (MNELAB) that was developed & tested by its creator using PySide6 from PyPI, as the code behaves differently with PySide6 from conda-forge.

@jschueller would you happen to know what's happening here?

cbrnr commented 1 year ago

Maybe the new enum system introduced with 6.4 is somehow disabled in the conda build?

jschueller commented 1 year ago

it comes from the PySide6/support/ submodule that is not installed by cmake, but present only in pip https://bugreports.qt.io/browse/PYSIDE-2183

hoechenberger commented 1 year ago

Thank you for filing this bug, @jschueller!