qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in “***“

qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “/home/yannqi/.local/lib/python3.8/site-packages/cv2/qt/plugins” even though it was found.问题汇总

问题报错:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/yannqi/.local/lib/python3.8/site-packages/cv2/qt/plugins" 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 (from /home/yannqi/.local/lib/python3.8/site-packages/cv2/qt/plugins), xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

问题解决方法汇总:

  1. 代码前加入如下片段,注意和原报错路径区分。解决博主问题。
envpath = '/home/yannqi/.local/lib/python3.8/site-packages/cv2/qt/plugins/platform'
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = envpath
  1. 通用解决方案。未解决博主问题,但评论区都说问题已解决的方案。
    apt-get install libxcb-xinerama0

  2. 其它方案,有说解决,有说未解决
    export QT_DEBUG_PLUGINS=1

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
qt.qpa.plugin: Could not load the Qt platform plugin "xcb"是一种错误消息,表示无法加载Qt平台插件"xcb"。这通常是由于缺少相关的库文件或配置问题导致的。为了解决这个问题,你可以尝试以下几种方法: 1. 确保你的系统已经安装了libSM.so.6库文件。你可以使用以下命令在Ubuntu中安装该库: ``` sudo apt-get install libsm6 ``` 2. 检查你的LD_LIBRARY_PATH环境变量是否正确设置。LD_LIBRARY_PATH指定了动态链接库(共享库)的搜索路径。你可以使用以下命令来查看当前的LD_LIBRARY_PATH设置: ``` echo $LD_LIBRARY_PATH ``` 如果LD_LIBRARY_PATH没有包含正确的路径,你可以使用export命令来设置它: ``` export LD_LIBRARY_PATH=/path/to/libraries ``` 请将"/path/to/libraries"替换为存放Qt平台插件的目录路径。 3. 如果你是在虚拟环境中使用Qt,尝试使用conda安装Qt和相应的库文件。使用conda可以更好地管理依赖关系,并确保正确的配置。 4. 另外,你还可以尝试重新安装Qt应用程序,以确保所有必需的插件都被正确初始化。 希望以上方法能够帮助你解决这个问题。如果问题仍然存在,请提供更多的详细信息,以便我们能够更好地帮助你解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Ubuntu18.04下解决Qt出现qt.qpa.plugin:Could not load the Qt platform pluginxcb“问题](https://download.csdn.net/download/weixin_38695061/12841039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [关于qt.qpa.plugin: Could not load the Qt platform pluginxcb“的问题](https://blog.csdn.net/Cl2212/article/details/124129813)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [解决qt.qpa.plugin: Could not load the Qt platform pluginxcb“问题](https://blog.csdn.net/threestooegs/article/details/124424434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值