linux问题解决记录:qt.qpa.plugin: Could not find the Qt platform plugin “wayland“ in ““

一、问题分析:

matplotlib库的调用有问题,可能是找不到wayland插件;

二、解决方法:(没解决)

1、安装qtwayland5

sudo apt-get install qtwayland5

显示qtwayland5 已经是最新版 (5.15.3-1),安装好了。若安装中出现问题,参考:dpkg: 处理软件包 xxx (–configure)时出错解决方法

2、安装好后查看位置

sudo find / -name qtwayland5

/usr/share/doc/qtwayland5

3、Linux添加环境变量,全局生效

/etc/profile []

sudo vim profile
export QT_QPA_PLATFORM=/usr/share/doc/qtwayland5:$PATH
echo $QT_QPA_PLATFORM

空的
在命令行直接

export QT_QPA_PLATFORM=/usr/share/doc/qtwayland5:$PATH

问题:

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, minimal, minimalegl, offscreen, vnc, webgl, xcb

安装libxcb-xinerama库:Ubuntu18.04下解决Qt出现qt.qpa.plugin:Could not load the Qt platform plugin “xcb“问题

#如果还存在其他依赖库没有安装,也一并安装。
$ sudo apt-get install libxcb-xinerama0

二. 解决方法

重新安装matplotlib ,重启linux
问题消失
出现新问题:

QObject::moveToThread: Current thread (0x99161300) is not the object's thread (0x991308c0). Cannot move to target thread (0x99161300) 
qt.qpa.plugin:Could not load the Qt platform plugin “xcb“

关注pyqt和opencv版本冲突问题
参考以上报错是由于使用 conda 安装 pyqt ,用 pip 安装 opencv ,由版本冲突导致的
具体解决步骤
卸载当前PYQT

conda uninstall pyqt

pip安装pyqt 和opencv

pip install PyQt5
pip install opencv-python-headless

可正常运行

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值