conda-forge / matplotlib-feedstock

A conda-smithy repository for matplotlib.
BSD 3-Clause "New" or "Revised" License
22 stars 58 forks source link

Requiring pyqt on Linux leads to conflicts with other common packages #348

Closed dan-blanchard closed 1 year ago

dan-blanchard commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

This package currently installs pyqt on Linux, which is both unnecessary for a lot of use cases (since people can use different backends), and leads to conflicts with common packages due to pyqt's dependencies.

For example, you cannot currently install both pyarrow with its latest version (12) and matplotlib to 3.7.1 because the qt's version pin conflicts with pyarrow's.

(base) mambauser@4d9c6b1309d6:/tmp$ micromamba create -c conda-forge -n test-pyarrow pyarrow=12 matplotlib~=3.7 --dry-run

                                           __
          __  ______ ___  ____ _____ ___  / /_  ____ _
         / / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
        / /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
       / .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
      /_/

conda-forge/noarch                                  12.1MB @   3.8MB/s  3.4s
conda-forge/linux-64                                31.2MB @   4.1MB/s  8.4s
error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ matplotlib ~=3.7  is installable with the potential options
    │  ├─ matplotlib [3.7.0|3.7.1] would require
    │  │  └─ python_abi 3.8 *_pypy38_pp73, which can be installed;
    │  ├─ matplotlib [3.7.0|3.7.1] would require
    │  │  ├─ pyqt >=5.10  with the potential options
    │  │  │  ├─ pyqt [5.12.3|5.15.4|5.15.7] would require
    │  │  │  │  ├─ pyqtwebengine [5.12.1 py310hfcd6d55_8|5.12.1 py36h7ec31b9_6|...|5.12.1 py39h0fcd23e_8], which requires
    │  │  │  │  │  └─ qt >=5.12.9,<5.13.0a0 , which requires
    │  │  │  │  │     └─ libevent >=2.1.10,<2.1.11.0a0 , which can be installed;
    │  │  │  │  ├─ qt >=5.12.9,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  │  └─ qt-main [5.15.* |>=5.15.3,<5.16.0a0 |>=5.15.4,<5.16.0a0 |>=5.15.6,<5.16.0a0 ], which requires
    │  │  │  │     └─ libevent >=2.1.10,<2.1.11.0a0 , which can be installed;
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi * *_cp27mu, which can be installed;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0  with the potential options
    │  │  │  │     ├─ qt 5.12.5 would require
    │  │  │  │     │  └─ openssl <3 , which can be installed;
    │  │  │  │     └─ qt [5.12.5|5.12.6|5.12.9], which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi 3.6.* *_cp36m, which can be installed;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi * *_cp36m, which can be installed;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi 3.7.* *_cp37m, which can be installed;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi * *_cp37m, which can be installed;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3 would require
    │  │  │  │  ├─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
    │  │  │  │  └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  │  └─ pyqt 5.12.3 would require
    │  │  │     ├─ python_abi * *_cp38, which can be installed;
    │  │  │     └─ qt >=5.12.5,<5.13.0a0 , which can be installed (as previously explained);
    │  │  └─ python_abi 3.10.* *_cp310, which conflicts with any installable versions previously reported;
    │  ├─ matplotlib [3.7.0|3.7.1] would require
    │  │  ├─ pyqt >=5.10  with the potential options
    │  │  │  ├─ pyqt [5.12.3|5.15.4|5.15.7], which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which cannot be installed (as previously explained);
    │  │  │  └─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  └─ python_abi 3.11.* *_cp311, which conflicts with any installable versions previously reported;
    │  ├─ matplotlib [3.7.0|3.7.1] would require
    │  │  ├─ pyqt >=5.10  with the potential options
    │  │  │  ├─ pyqt [5.12.3|5.15.4|5.15.7], which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  │  ├─ pyqt 5.12.3, which cannot be installed (as previously explained);
    │  │  │  └─ pyqt 5.12.3, which can be installed (as previously explained);
    │  │  └─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
    │  ├─ matplotlib [3.7.0|3.7.1] would require
    │  │  └─ python_abi 3.9 *_pypy39_pp73, which can be installed;
    │  └─ matplotlib [3.7.0|3.7.1] would require
    │     ├─ pyqt >=5.10  with the potential options
    │     │  ├─ pyqt [5.12.3|5.15.4|5.15.7], which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which can be installed (as previously explained);
    │     │  ├─ pyqt 5.12.3, which cannot be installed (as previously explained);
    │     │  └─ pyqt 5.12.3, which can be installed (as previously explained);
    │     └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported;
    └─ pyarrow 12**  is uninstallable because there are no viable options
       ├─ pyarrow 12.0.0 would require
       │  ├─ libarrow [12.0.0 h07599e3_0_cuda|12.0.0 h1cdf7b0_1_cpu|12.0.0 h45d318b_1_cuda|12.0.0 h4c9df9b_0_cpu], which requires
       │  │  ├─ libevent >=2.1.12,<2.1.13.0a0 , which conflicts with any installable versions previously reported;
       │  │  └─ libthrift >=0.18.1,<0.18.2.0a0  with the potential options
       │  │     ├─ libthrift 0.18.1 would require
       │  │     │  └─ openssl >=3.1.0,<4.0a0 , which conflicts with any installable versions previously reported;
       │  │     └─ libthrift 0.18.1 would require
       │  │        └─ libevent >=2.1.10,<2.1.11.0a0 , which can be installed;
       │  └─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
       ├─ pyarrow 12.0.0 would require
       │  ├─ libarrow [12.0.0 h07599e3_0_cuda|12.0.0 h1cdf7b0_1_cpu|12.0.0 h45d318b_1_cuda|12.0.0 h4c9df9b_0_cpu], which cannot be installed (as previously explained);
       │  └─ python_abi 3.10.* *_cp310, which conflicts with any installable versions previously reported;
       ├─ pyarrow 12.0.0 would require
       │  ├─ libarrow [12.0.0 h07599e3_0_cuda|12.0.0 h1cdf7b0_1_cpu|12.0.0 h45d318b_1_cuda|12.0.0 h4c9df9b_0_cpu], which cannot be installed (as previously explained);
       │  └─ python_abi 3.11.* *_cp311, which conflicts with any installable versions previously reported;
       └─ pyarrow 12.0.0 would require
          ├─ libarrow [12.0.0 h07599e3_0_cuda|12.0.0 h1cdf7b0_1_cpu|12.0.0 h45d318b_1_cuda|12.0.0 h4c9df9b_0_cpu], which cannot be installed (as previously explained);
          └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported.

If I install both matplotlib-base and matplotlib-inline instead, I can successfully draw plots in Jupyter and use the latest version of pyarrow, so the inclusion of pyqt in this metapackage feels a bit unnecessary.

Installed packages

pyarrow=12 
matplotlib~=3.7

Environment info

environment : base (active)
           env location : /opt/conda
      user config files : /home/mambauser/.mambarc
 populated config files :
       libmamba version : 1.4.2
     micromamba version : 1.4.2
           curl version : libcurl/7.88.1 OpenSSL/3.1.0 zlib/1.2.13 zstd/1.5.2 libssh2/1.10.0 nghttp2/1.52.0
     libarchive version : libarchive 3.6.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.2
       virtual packages : __unix=0=0
                          __linux=5.15.49=0
                          __glibc=2.31=0
                          __archspec=1=x86_64
               channels :
       base environment : /opt/conda
               platform : linux-64
(base) mambauser@eb2cd5bc5565:/tmp$
dopplershift commented 1 year ago

The whole point of the metapackage is to be matplotlib-base + the pyqt backend?

dan-blanchard commented 1 year ago

It's pretty confusing from a user standpoint that if you have an environment file from macOS that includes both pyarrow and matplotlib pinned to their latest versions, that will solve fine on macOS, but when you share that with a Linux user, it will not solve because qt conflicts with pyarrow.

dopplershift commented 1 year ago

I get that, but there's not a lot we can do. The original matplotlib package, going back as far as Anaconda defaults, was made to include the PyQt backend. We can't change that without breaking every user that expects conda install matplotlib to give them an environment that includes matplotlib with a fully functioning PyQt backend. And it would be really confusing to have conda install -c defaults matplotlib and conda install -c conda-forge matplotlib result in very different experiences.

In conda-forge, we decided to introduce matplotlib-base that gave the the bare essential matplotlib install that users can then add things to (wxpython, gtk, inline, whatever they want), without changing the previous matplotlib package.

dopplershift commented 1 year ago

IMO, the real solution is to resolve the incompatibility between pyarrow and Qt, but that's outside my wheelhouse.