zoukankan      html  css  js  c++  java
  • CentOS安装PyQT5

    CentOS安装PyQT5.11

    yum install qt5-qtbase-devel
    pip3 install pyqt5
    python3 -c "from PyQt5 import QtWidgets"

    CentOS安装PyQT5.6

    一、安装CentOS7

    1. 安装完成后进行更新
      sudo yum update -y
    2. 增加epel 源
      yum install epel-release -y

    二、 安装qt5

    1. 安装qt5.6
      yum install qt5-qtquickcontrols qt5-qtdeclarative-devel -y

    三、 安装PyQT5

    1. 安装编译环境
      yum install gcc gcc-c++ python-devel -y
    2. 下载sip-4.18
      wget http://nchc.dl.sourceforge.net/project/pyqt/sip/sip-4.18/sip-4.18.tar.gz
    3. 装sip-4.18
       sudo tar xzvf sip-4.18.tar.gz
        sudo cd sip
       sudo python configure.py
       sudo make
       sudo make install
    
    1. 下载pyqt5.6
      wget http://nchc.dl.sourceforge.net/project/pyqt/PyQt5/PyQt-5.6/PyQt5_gpl-5.6.tar.gz
    2. 安装qt5-qtbase-devel
      yum install qt5-qtbase-devel -y
    3. 编译并安装 pyqt
       sudo tar xzvf PyQt5_gpl-5.6.tar.gz
       sudo cd PyQt5_gpl-5.6
       sudo python configure.py --qmake=/usr/bin/qmake-qt5
       sudo make all
       sudo make install

    tip:
      1.步骤sudo python configure.py --qmake=/usr/bin/qmake-qt5会出错:
        Error: This version of PyQt5 and the commercial version of Qt have incompatible licenses.
         解决办法:
        vi configure.py #大约在2681行,可根据关键字搜索
                  修改红色标记处: if introspecting and target_config.qt_licensee not in 'Open Source' and ltype == 'GPL':

      2. 步骤sudo make all 会出错:

        error: 'WindowOkButtonHint' : is not a member of 'Qt'

        error: 'WindowCancelButtonHint' : is not a member of 'Qt'

      解决办法:根绝报错大约是在/root/PyQt5_gpl-5.6/QtCore/sipQtCoreQt.cpp 的1085和1098行,  删除这两行就好了


    from:https://stackoverflow.com/questions/31825633/pyqt5-5-and-qt5-licence-issue

     
  • 相关阅读:
    ffmpeg rtmp推流 视频转码
    java日志发展史 log4j slf4j log4j2 jul jcl 日志和各种桥接包的关系
    nginx stream 流转发,可以转发rtmp、mysql访问流,转发rtmp、jdbc请求
    java web http 转https 通过nginx代理访问
    linux 服务器磁盘挂载
    novnc 通过websockify代理 配置多点访问
    linux 文件服务 minio 安装部署配置
    AOP实现原理,手写aop
    java 泛型
    JAVA反射getGenericSuperclass()用法
  • 原文地址:https://www.cnblogs.com/chenpengzi/p/9441320.html
Copyright © 2011-2022 走看看