安装包下载
Linux安装PyQt4
主要参考文档 CentOS6.5安装PyQt4
成功安装的各个组件的版本号:
巨坑
安装sip-4.19,等安装PyQt4_gpl_x11-4.12.3的时候提示sip版本太低,所以使用PyQt-x11-gpl-4.11.4,但是在执行make的时候报错,最后是使用sip-4.19.12,以及PyQt4_gpl_x11-4.12.3,得以成功。
make时遇到如下问题,试着按照链接的文档解决,没有作用
make: *** No targets specified and no makefile found. Stop.
https://blog.youkuaiyun.com/l1028386804/article/details/48710993
安装Qt时执行./configure
成功后打出的log最后应该长这样
Qt is now configured for building. Just run 'gmake'.
Once everything is built, you must run 'gmake install'.
Qt will be installed into /usr/local/Trolltech/Qt-4.8.7
To reconfigure, run 'gmake confclean' and 'configure'.
CentOS6.5默认Python2.6
版本,安装包的路径在/usr/lib64/python2.6/site-packages
Mac安装PyQt4
主要参考文档 PyQt for Mac安装
操作时注意qmake路径
which qmake
python configure-ng.py -q /usr/bin/qmake -d /Library/Python/2.7/site-packages/ --sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
sip模块安装失败参考 Mac SIP系统完整性保护
其他搜到的文档
https://blog.youkuaiyun.com/watsy/article/details/8857252
https://blog.youkuaiyun.com/wdkirchhoff/article/details/22572599
https://blog.youkuaiyun.com/longchena/article/details/79204596
Mac安装PyQt5
➜ ~ brew install python3
Python has been installed as
/usr/local/bin/python3
If you need Homebrew’s Python 2.7 run
brew install python@2
Pip, setuptools, and wheel have been installed. To update them run
pip3 install --upgrade pip setuptools wheel
You can install Python packages with
pip3 install
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages
➜ ~ which python
/usr/bin/python
➜ ~ which python3
/usr/local/bin/python3
➜ ~ sudo easy_install pip3
No local packages or download links found for pip3
error: Could not find suitable distribution for Requirement.parse(‘pip3’)
➜ ~ cd /usr/local/bin
➜ bin pip3.7 install sip
Successfully installed sip-4.19.8
➜ bin pip3.7 install sip
Requirement already satisfied: sip in /usr/local/lib/python3.7/site-packages (4.19.8)
➜ bin pip3.7 install PyQt5
Successfully installed PyQt5-5.11.2 PyQt5-sip-4.19.12
>>> from PyQt5.QtWebKit import *
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘PyQt5.QtWebKit’
>>> from PyQt5.QtWebKitWidgets import *
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘PyQt5.QtWebKitWidgets’
PyQt5跟PyQt4很多模块已经不一致
https://www.cnblogs.com/zxpo/p/7562968.html
from PyQt5.QtWebEngineWidgets import *