zoukankan      html  css  js  c++  java
  • Deepin下搭建pyqt5开发环境——基于vscode

    1.安装pyqt5

    sudo apt-get install pyqt5*

    2.安装QT5开发工具,里面包含了Qt Designer等工具

    sudo apt-get install qttools5-dev-tools

    3.打开vscode,搜索pyqt,安装PYQT Integration插件

    4.点击小齿轮-->扩展设置,对PYQT Integration插件进行设置

    5.在Pyqt-integration › Qtdesigner: Path中,增加QT designer的路径

    /usr/lib/x86_64-linux-gnu/qt5/bin/designer

     

    这样完成了对Deepin下pyqt5开发环境的搭建

    可能出现的错误提示:

    错误提示1

    Error: Command failed: "pyuic5" -p "/home/nexfia/Documents/PyQt5 Project/PDFDecryptionTool/WinUI.ui"
    
    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.
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
    
    Aborted

    错误提示2

    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.
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

    错误提示1是使用PYQT Integration插件对.ui文件进行预览时提示的。

    错误提示2时python程序导入了pyqt5,运行程序时提示的

    这2个错误的原因在于你装了多个pyqt5

    一个可能是使用 pip 安装了一个

    pip3 install pyqt5

    另一个可能是使用我上面的命令安装了一个

    sudo apt-get install pyqt5*

    导致不知道用那个xcb

    解决方法是将使用pip安装的pyqt5卸载掉

    pip3 uninstall pyqt5
  • 相关阅读:
    中台入门系列1
    微服务 2.0 技术栈选型手册
    mysql计划任务每天定时执行
    更高效地提高redis client多线程操作的并发吞吐设计
    azure之MSSQL服务性能测试
    .NET Socket服务编程之-高效连接接入编
    轻易实现基于linux或win运行的聊天服务端程序
    零配置Socket TCP消息通讯服务容器EC
    azure存储压测的问题(农码主观意识太强被坑了)
    业务逻辑层缓存应该设计
  • 原文地址:https://www.cnblogs.com/syxy/p/14721832.html
Copyright © 2011-2022 走看看