pep-dortmund / homepage-toolbox

Website for the PeP et al. Toolbox Workshop at TU Dortmund
http://toolbox.pep-dortmund.org
3 stars 1 forks source link

Add short paragraph on Qt troubleshooting #308

Closed aknierim closed 3 months ago

aknierim commented 3 months ago

This adds an instruction on how to fix the

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

error that one may encounter when executing %matplotlib in an ipython shell. I have encountered this several times now on devices using the WSL2 (hence why I only added this to the Win10/11 instructions).

The fix that worked most of the times is adding

export QT_QPA_PLATFORM=xcb

to the .bashrc/.zshrc, thus setting the Qt platform to run on an X11 server.

maxnoe commented 3 months ago

Is this really the correct solution?

I think it would be preferred to use Wayland in the WSL setup, right?

So installing mamba install qt-wayland should be the better fix?

aknierim commented 3 months ago

Is this really the correct solution?

Well it is one solution... Or at least the easiest.

I think it would be preferred to use Wayland in the WSL setup, right? So installing mamba install qt-wayland should be the better fix?

The problem is that that would require people to install qt-wayland in every environment they create, which I know for certain will rarely happen...

SepplL commented 3 months ago

Given that many of the major Linux distros also move to Wayland more and more (supported by both gnome and KDE massively moving in that direction as well) applying a fix to stay on legacy code could present not being the best solution here. Is there no way of fixing the whole wsl2 issue with Wayland as a whole? Maybe by installing xwayland or something similar from the distro's package manager?

aknierim commented 3 months ago

Is there no way of fixing the whole wsl2 issue with Wayland as a whole?

None that I have found so far... I also can confirm now that, at least in one case I know of, installing qt-wayland via mamba did not fix the issue.