I recently upgraded Ubuntu to the lasted version, and got this error running a python script by command line.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found
to solve this:
sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
then re-boot your terminal.