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
  • 相关阅读:
    Docker容器案例:应用 Mysql
    rpm 命令参数使用详解
    MySQL中的两种临时表
    Yum本地Rpm库设置
    编程学习 博客
    yum -------包安装库
    Linux 基础 —— RPM
    在CentOS上编译安装PostgreSQL
    Linux上安装JDK环境变量配置
    yum_rpm(利用dvd建立本地yum库)
  • 原文地址:https://www.cnblogs.com/syxy/p/14721832.html
Copyright © 2011-2022 走看看