Mac配置PyQt

Mac OS X 配置 PyQt

配置过程略繁琐,首先要安装qmake 然后安装sip  然后安装PyQt4/PyQt5 再然后想安装Eric的话需要安装QScintilla2
1.安装qmake
去http://www.qt.io/download-open-source/ 下载Qt安装包,License 选择GNU 不然后面没发安装PyQt

安装好后配置环境变量

[code]
export PATH="/Users/lvxinwei/Qt/5.5/clang_64/bin:$PATH"
[/code]

写在 .bash_profile 然后source .bash_profile
然后运行qmake看下是否成功了
2.下面安装sip
下载好sip后

[code]
python configure.py
make
sudo make install
[/code]

3.安装PyQt

[code]
python configure.py -d /Library/Python/2.7/site-packages/ –sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
make
sudo make install
[/code]

4.安装QScintilla2
先进入Qt4Qt5 然后

[code]
qmake qscintilla.pro -spec macx-g++
make
sudo make install
[/code]

再进入Python目录

[code]
python configure.py –sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
[/code]

再然后进去designer-Qt4Qt5 目录

[code]
qmake designer.pro -spec macx-g++
make
sudo make install
[/code]

完成