解决ubuntu系统运行pyside2或6的问题

编程入门 行业动态 更新时间:2024-10-09 12:27:49

解决ubuntu<a href=https://www.elefans.com/category/jswz/34/1770742.html style=系统运行pyside2或6的问题"/>

解决ubuntu系统运行pyside2或6的问题

解决ubuntu系统运行pyside2或6时出现的问题

当运行程序时,出现“qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “/usr/local/lib/python3.6/dist-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“,通过一下操作,可有效解决该问题

  1. 输出详细的运行信息

    export QT_DEBUG_PLUGINS=1
    
  2. 找到报错的位置(仅针对本人系统报错):

  3. 查看报错位置的缺失动态链接库

    ldd /home/brainiac/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so | grep "not found"
    
  4. 确认库文件是否存在

    ls /usr/lib/libxcb-cursor.so.0
    
  5. 不存在则进行安装(找准库文件实际名称)

    # 对于基于 Debian 的系统(如 Ubuntu):
    sudo apt-get install libxcb-cursor0
    # 对于基于 Red Hat 的系统(如 Fedora):
    sudo dnf install libxcb-cursor
    # 对于基于 Arch 的系统(如 Arch Linux):
    sudo pacman -S xcb-util-cursor
    
  6. 安装好之后更新动态链接库缓存

    sudo ldconfig
    
  7. 重启应用程序,问题解决

更多推荐

解决ubuntu系统运行pyside2或6的问题

本文发布于:2023-12-07 22:49:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1671848.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:系统   ubuntu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!