【Ubuntu】PySide6を使う

はじめに

Ubuntu 22.04でPySide6を使おうとするとエラーが出ました。

エラー表示

qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland, minimal, vnc, wayland-egl, vkkhrdisplay, linuxfb, offscreen, xcb, minimalegl, eglfs.

解決策

以下の1行で解決。

sudo apt install libxcb-cursor0