1、安装pyqt5(注:测试Python3.6版本可用) #brew install pyqt (注:此命令会安装所依赖的sqlite、python3、python、qt、sip所需软件) #cd /usr/local/bin #rm python #ln -s python3.6 python 2、第一个helloword.py #! /usr/bin/python3 # coding = utf-8 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('Hello world') w.show() sys.exit(app.exec_()) 3、运行程序 # python helloworld.py 参考:http://www.jianshu.com/nb/4634983