I had an issue and I solved it, and I figured I’d document it here in case anyone else runs into it. For some reason, after installing mrtrix3 through miniconda on Ubuntu 18.04, mrview didn’t work. It gave a linking error, citing that it could not find or load the Qt platform package “xcb” in “”. The “” tipped me off that it was failing to find it at all.
After scrubbing around the internet, what worked was exporting the Qt5 plugins path, as per the post here. So, add to your preferred config file (e.g., ~/.bashrc):
export QT_PLUGIN_PATH=<qt base path>/plugins
where you should sub in <qt base path> with the relevant plugins path. You can use dpkg with the --list-files argument to hunt down where qt5 can be found.
Just adding to this thread as I’ve just been struggling to get mrview running on Windows 11 running WSL1. I had been receiving the classic error:
qt.qpa.xcb: could not connect to display
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.
I tried running with extended debugging (export QT_DEBUG_PLUGINS=1), but nothing obvious appeared. I tried all the other tips shared throughout this community (thanks everyone!) but also no luck. I tried other tips from across the web (e.g. ldd \wsl.localhost\Ubuntu-20.04\usr\lib\x86_64-linux-gnu\qt5\plugins\platforms\libqxcb.so) but no libraries were missing.
But in the end I was successful! The trick? This page suggested I needed to install vcxsrv, so I did, and now mrview runs!