I am trying to plot things with pyplot on linux using pycharm. However, every time I try to show a plot I get the following error.
QObject::moveToThread: Current thread (0x556ba671bce0) is not the object's thread (0x556ba6a9dc30).
Cannot move to target thread (0x556ba671bce0)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "path" 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: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.
I tried reinstalling xcb using
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
but it did not work.