windows系统安装pyqt5
pyqt是python一个GUI库,但再利用pip的安装过程中,出错的几率比较大。
1、注意,一定要再cmd的管理员模式下,对pip版本进行升级,以win10为例,在搜索框输入“命令”,鼠标右击出现的cmd的命令提示符,以管理员模式运行。
我的系统一直提示,pip版本目前是19.0.3, 需要升级到19.1.1,管理员模式下,如下成功升级:
Microsoft Windows [版本 10.0.16299.1217]
© 2017 Microsoft Corporation。保留所有权利。
C:\WINDOWS\system32>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.0.3
Uninstalling pip-19.0.3:
Successfully uninstalled pip-19.0.3
Successfully installed pip-19.1.1
安装pyqt,仍然在管理员模式下安装,输入命令:pip install PyQt5
C:\WINDOWS\system32>pip install PyQt5
Collecting PyQt5
Using cached https://files.pythonhosted.org/packages/3b/d3/76670a331935f58f9a2ebd53c6e9b670bbf15c458fa6993500af5d323160/PyQt5-5.13.0-5.13.0-cp35.cp36.cp37.cp38-none-win_amd64.whl
Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5)
Using cached https://files.pythonhosted.org/packages/cf/c8/1e9eda4ba09a84fc528d4c87001de2d7a8cbbe04c2a834af3eb81a0ecd88/PyQt5_sip-4.19.18-cp37-none-win_amd64.whl
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.13.0 PyQt5-sip-4.19.18
PyQt5的包会出现在Python目录下Lib/site-packages目录下