I need to install PyQt6 on a fresh install of Ubuntu 22.04. I use python 3.11.5 via Pyenv and the Poetry package manager. There are no errors during installing or importing, but calling the QApplication function causes the following error to appear:
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: eglfs, minimalegl, minimal, vnc, offscreen, linuxfb, vkkhrdisplay, wayland-egl, xcb, wayland.
I have already tried reinstalling the application. I have also tried using python 3.9, setting the QT_QPA_PLATFORM_PLUGIN_PATH and installing using pip in Pyenv. I checked, and the libqxcb.so file does indeed exist in the right location within the PyQt6 package.
Does anyone know what causes this error, and how can it be fixed, preferably using the poetry package manager?
sudo apt-get install python3-pyqt5
. I'm not sure if it works the same for qt6, and I'm a bit too lazy to search for my old computer to test this. – Rishon_JR Sep 11 '23 at 14:10