Mac可视化开发Qt + PyQt + Eric

时间:2021-05-11 23:12:03

一.安装Qt

方法1:官网下载Qt | Cross-platform software development for embedded & desktop,dmg文件双击安装,配置环境:

vim ~/.bash_profile
#添加一下内容,x是你的版本
#Setting PATH for Qt 5.x 
PATH="/Users/xxx/Qt5.x.x/5.x/clang_64/bin:${PATH}"
export PATH
#按Esc键->输入":Wq"保存并退出

方法2:brew安装,命令:

brew install qt
#配置
brew link qt
brew linkapps qt

二.安装SIP

方法1:brew安装,命令:

brew install sip
方法2:下载 Riverbank | Software,接着终端操作:
cd /Users/xxx/Downloads/ #切换到下载文件目录
tar zxvf sip-x.x.x.tar #解压下载好的sip文件
#安装sip,x是你的版本
python configure.py -d /Library/Python/2.x/site-packages #python2安装
python3 configure.py -d /Library/Python/3.x/site-packages #python3安装

sudo make && date
添加sip配置
sudo vim ~/.bash_profile
#Setting PATH for sip x.x
PATH="/System/Library/Frameworks/Python.framework/Versions/x.x/bin:${PATH}"
export PATH
#按Esc输入“:wq”保存并退出

三. 安装PyQt
方法1:brew安装,命令:
brew install PyQt5

方法2:下载Riverbank | Software,进入终端:

cd /Users/xxx/Downloads/ #切换文件下载目录
tar zvxf PyQt5_gpl-5.x.tar #解压文件
#python2.x
python configure.py -q /Users/xxx/Qt5.x.x/5.x/clang_64/bin/qmake --disable=QtPositioning -d /Library/Python/2.7/site-packages --sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
#python3.x
python3 configure.py -q /Users/xxx/Qt5.x.x/5.x/clang_64/bin/qmake --disable=QtPositioning -d /Library/Python/3.x/site-packages --sip /System/Library/Frameworks/Python.framework/Versions/3.x/bin/sip #不行的话需要brew安装

sudo make #编译
sudo make install #安装

四.Qsci安装

方法1:pip安装,命令:

pip3 install Qscintilla

方法2:下载Riverbank | Software,终端:

#进入解压文件夹
#安装Qt4Qt5模块
cd Qt4Qt5
qmake qscintilla.pro
make && date
sudo make install && date
#安装Python模块
cd Python
python configure.py --pyqt=PyQt5 -d /Library/Python/2.7/site-packages/PyQt5
--sip
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
make && date
sudo make install && date
#安装designer-Qt4Qt5
cd designer-Qt4Qt5
qmake designer.pro
make && date
sudo make install && date
五.安装Eric6
下载 Eric Integrated Development Environment,选择tar.gz文件(mac版),进入终端:
cd /Users/xxx/Downloads/ #切换下载目录
tar zvxf eric6-6.x.x.tar
cd eric6-6.x.x
sudo python install.py #python2.x
sudo python3 install.py #python3.x