$ su
# 设置环境参数
# virtualenv --python=python3.4 env
# source env/bin/activate
# python --version
# 安装
# dnf groupinstall 'Development Tools'
$ dnf install gcc gcc-c++
$ dnf install python
$ dnf install python3 python3-devel
$ dnf install python3-qt5 python3-qt5-devel
$ dnf install qt5-qtbase qt5-qtbase-devel qt5-qtwebkit
$ wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.18/sip-4.18.tar.gz
$ tar xzf sip-4.18.tar.gz
$ cd sip-4.18
$ python configure.py
$ make
$ make install
$ cd ..
$ rm -rf sip-4.18
$ wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.5/PyQt-gpl-5.5.tar.gz
$ tar xzf PyQt-gpl-5.5.tar.gz
$ cd PyQt-gpl-5.5
$ python configure.py --qmake /usr/bin/qmake-qt5
$ make # 这行很花时间, 要有心理准备咯
$ make install
$ cd ..
$ rm -rf PyQt-gpl-55
# 测试
$ gedit test.py
内容如下:
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == "__main__":
app = QApplication(sys.argv)
window = QMainWindow()
window.show()
sys.exit(app.exec_())
运行
$ python test.py
没有评论:
发表评论