conda-forge / pyside2-feedstock

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

OSX: PySide6 doesn't work when PyQt5 is installed #183

Closed cbrnr closed 1 year ago

cbrnr commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

In theory, it should be possible to install both PySide6 and PyQt5 in parallel. However, this does not work with the corresponding conda-forge packages pyside6 and pyqt.

$ mamba create -n qt pyqt pyside6
$ conda activate qt
$ python -c "from PyQt5.QtWidgets import QApplication, QWidget; app = QApplication([])"
$ python -c "from PySide6.QtWidgets import QApplication, QWidget; app = QApplication([])"

Whereas PyQt5 works, PySide6 gives the following error when running the command above:

qt.core.plugin.loader: In /Users/clemens/mambaforge/envs/qt/plugins/platforms/libqwebgl.dylib:
  Plugin uses incompatible Qt library (5.15.0) [release]
qt.core.plugin.loader: In /Users/clemens/mambaforge/envs/qt/plugins/platforms/libqoffscreen.dylib:
  Plugin uses incompatible Qt library (5.15.0) [release]
qt.core.plugin.loader: In /Users/clemens/mambaforge/envs/qt/plugins/platforms/libqminimal.dylib:
  Plugin uses incompatible Qt library (5.15.0) [release]
qt.core.plugin.loader: In /Users/clemens/mambaforge/envs/qt/plugins/platforms/libqcocoa.dylib:
  Plugin uses incompatible Qt library (5.15.0) [release]
qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

[1]    15574 abort      python3 -c 

After mamba uninstall pyqt, this command works without errors.

Installed packages

# packages in environment at /Users/clemens/mambaforge/envs/qt:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                h0d85af4_4    conda-forge
ca-certificates           2022.12.7            h033912b_0    conda-forge
cairo                     1.16.0            h297c08e_1015    conda-forge
double-conversion         3.2.0                hf0c8a7f_1    conda-forge
expat                     2.5.0                hf0c8a7f_1    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.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h3f81eb7_1    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
glib                      2.76.2               h7d26f99_0    conda-forge
glib-tools                2.76.2               h7d26f99_0    conda-forge
graphite2                 1.3.13            h2e338ed_1001    conda-forge
gst-plugins-base          1.22.0               h37e1711_2    conda-forge
gstreamer                 1.22.0               h1d18e73_2    conda-forge
harfbuzz                  6.0.0                hc28939c_1    conda-forge
icu                       72.1                 h7336db1_0    conda-forge
krb5                      1.20.1               h049b76e_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libclang                  14.0.6          default_h55ffa42_0    conda-forge
libclang13                14.0.6          default_hb5731bd_0    conda-forge
libcxx                    16.0.2               hd57cbcb_0    conda-forge
libdeflate                1.18                 hac1461d_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libexpat                  2.5.0                hf0c8a7f_1    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libglib                   2.76.2               hc62aa5d_0    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
libjpeg-turbo             2.1.5.1              hb7f2c08_0    conda-forge
libllvm14                 14.0.6               h5b596cc_1    conda-forge
libogg                    1.3.4                h35c211d_1    conda-forge
libopus                   1.3.1                hc929b4f_1    conda-forge
libpng                    1.6.39               ha978bb4_0    conda-forge
libpq                     15.2                 h3640bf0_0    conda-forge
libsqlite                 3.40.0               ha978bb4_1    conda-forge
libtiff                   4.5.0                hedf67fa_6    conda-forge
libvorbis                 1.3.7                h046ec9c_0    conda-forge
libwebp-base              1.3.0                hb7f2c08_0    conda-forge
libxml2                   2.10.4               h554bb67_0    conda-forge
libxslt                   1.1.37               h5d22bc9_0    conda-forge
libzlib                   1.2.13               hfd90126_4    conda-forge
mysql-common              8.0.32               hc4b2c72_1    conda-forge
mysql-libs                8.0.32               h8658499_1    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
nspr                      4.35                 hea0b92c_0    conda-forge
nss                       3.89                 h78b00b3_0    conda-forge
openssl                   3.1.0                h8a1eda9_1    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h1c4e4bc_0    conda-forge
pip                       23.1.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
ply                       3.11                       py_1    conda-forge
pyqt                      5.15.7          py311h8771221_3    conda-forge
pyqt5-sip                 12.11.0         py311h78fa98d_3    conda-forge
pyside6                   6.5.0           py311hee85f53_1    conda-forge
python                    3.11.3          h99528f9_0_cpython    conda-forge
python_abi                3.11                    3_cp311    conda-forge
qt-main                   5.15.8               h0afe88e_9    conda-forge
qt6-main                  6.5.0                h9bbdc2a_4    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
setuptools                67.7.1             pyhd8ed1ab_0    conda-forge
sip                       6.7.9           py311hdf8f085_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
zlib                      1.2.13               hfd90126_4    conda-forge
zstd                      1.5.2                hbc0c0cd_6    conda-forge

Environment info

active environment : qt
    active env location : /Users/clemens/mambaforge/envs/qt
            shell level : 2
       user config file : /Users/clemens/.condarc
 populated config files : /Users/clemens/mambaforge/.condarc
          conda version : 23.1.0
    conda-build version : not installed
         python version : 3.10.10.final.0
       virtual packages : __archspec=1=x86_64
                          __osx=11.7.6=0
                          __unix=0=0
       base environment : /Users/clemens/mambaforge  (writable)
      conda av data dir : /Users/clemens/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/clemens/mambaforge/pkgs
                          /Users/clemens/.conda/pkgs
       envs directories : /Users/clemens/mambaforge/envs
                          /Users/clemens/.conda/envs
               platform : osx-64
             user-agent : conda/23.1.0 requests/2.28.2 CPython/3.10.10 Darwin/20.6.0 OSX/11.7.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False
hmaarrfk commented 1 year ago

There are some integration challenges on osx.

Please see https://github.com/conda-forge/qt-main-feedstock/issues/150#issuecomment-1509895145

I think the issues are common for x86 and arm

cbrnr commented 1 year ago

Is there anything I can do to help? It seems to me that the solution is to make PySide6 use bin/qt6.conf, but I am not really familiar with the intricacies of the issue. I tested only with x86, but I assume that the problem also affects arm64.

hmaarrfk commented 1 year ago

Let's discuss on the other issue.

cbrnr commented 1 year ago

Alright, feel free to close this issue if it is really a duplicate and if it can be fixed over there.

hmaarrfk commented 1 year ago

Let's keep it open for visibility. But the solution I'm fairly confident is in qt-main (first) then maybe a follow-on here.

jschueller commented 1 year ago

I tested and its ok now