ubuntu20.04 报错:This application failed to start because no Qt platform plugin could be initialized.

我是在用freeview的时候出现这个问题,freesurfer正常但是freeview打不开

查了一下是因为freeview中调用的python依赖qt,但是qt没装好

试了很多方法,最后真正对我有效的是:

1.先sudo gedit ~/.bashrc

打开配置文件,在后面加一行

export QT_DEBUG_PLUGINS=1

然后保存,source一下配置文件

2.再运行freeview,这个时候会详细报告缺少哪些库

比如我就是:

Cannot load library /home/free/freesurfer/lib/qt/plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/free/freesurfer/lib/qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/free/freesurfer/lib/qt/plugins/platforms/libqxcb.so: (libxcb-xinput.so.0: cannot open shared object file: No such file or directory)"
 

然后根据报错安装你缺少lib,我是:

sudo apt install libxcb-xinput0

3.再freeview就可以打开了

其他类似的依赖于qt的命令也可以参考这个

你可能感兴趣的:(qt,开发语言)