Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python environment with matplotlib and jupyter causes run-time Qt version conflicts in LXQt desktop environment #299385

Open
ShamrockLee opened this issue Mar 27, 2024 · 0 comments

Comments

@ShamrockLee
Copy link
Contributor

Describe the bug

When constructing a python environment wrapper, picking up matplotlib and jupyter, executing python3 inside a terminal emulator on LXQt desktop environment, and plotting with plot() provided by matplotlib.pyplot, MatPlotLib complains

Cannot mix incompatible Qt library (5.15.11) with this library (5.15.12)
Aborted (core dumped)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Boot into a NixOS on commit cf28ee2 nixos-23.11 branch, where the version of Qt 5 is 5.15.11.
  2. Start a graphical session with LXQt desktop environment.
  3. Open a terminal emulator (I use Alacritty).
  4. Type lxqt-about --version and see the Qt version. Mine is
  5. cd to the Nixpkgs project directory.
  6. Check out nixos-unstable or nixos-23.11 (56528ee or later) where the Qt 5 version is 5.15.12 or later.
  7. See the Qt 5 version with nix eval .#qt5.full.name. The output on my machine is "qt-full-5.15.12".
  8. Enter the Python interactive environment by running nix run --impure --expr "(import ./. { }).python3.withPackages (ps: with ps; [ matplotlib jupyter ])".
  9. Type import matplotlib.pyplot as plt and press enter
  10. Type plt.plot([1, 2, 3], [1, 1, 1]) and press enter

One-liner of the Python execution part:
nix shell --impure --expr "(import ./. { }).python3.withPackages (ps: with ps; [ matplotlib jupyter ])" -c python3 -c "__import__('matplotlib.pyplot').pyplot.plot([1, 2, 3], [1, 1, 1])"
(It cannot be replaced with nix run due to a Nix bug NixOS/nix#8900.)

Expected behavior

There should be no error and no abortion. The interactive environment should print something like [<matplotlib.lines.Line2D object at 0x7fb179f10d50>] after plot(), and show the plot after plt.show(). The one-liner should print nothing.

Screenshots

Screenshot of the python-interactive-environment-based reproducer

Additional context

$ lxqt-about -v
lxqt-about 1.4.0
liblxqt   1.4.0
Qt        5.15.11

Notify maintainers

@lovek323 @veprbl (MatPlotLib maintainers)
@costrouc (author of a Jupyter refactoring commit 6102dd1)
@FRidh (Python package committer)
@romildo (LXQt maintainer)

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a 👍 reaction to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant