树莓派 python2.7 安装pyqt5 运行环境

sudo apt-get install qt5-default

sudo apt-get install python-pyqt5

测试代码:

import sys
from PyQt5.QtWidgets import QApplication, QWidget


if __name__ == '__main__':
    
    app = QApplication(sys.argv)

    w = QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Simple')
    w.show()
    
    sys.exit(app.exec_())

 

你可能感兴趣的:(python)