最近在配置pyqtchart时候,pip安装的时候一直卡在,最后卡的我的unbuntu界面啥都动不了,最后只能无奈关机。
这里是安装过程,可见一直卡在Preparing wheel metadata ... -。
Collecting PyQtChart
Using cached PyQtChart-5.15.6-cp37-abi3-manylinux1_x86_64.whl (306 kB)
Collecting PyQt5-sip<13,>=12.11
Using cached PyQt5_sip-12.13.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (335 kB)
Collecting PyQtChart-Qt5>=5.15.0
Using cached PyQtChart_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (925 kB)
Collecting PyQt5>=5.15.4
Using cached PyQt5-5.15.10.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... -
最后查阅资料发现pyqtchart对pyqt5版本有依赖,所以就安装了二者相同的版本,就成功了
pyqt5安装对应版本,这里是5.15.0使用清华源
pip install PyQt5==5.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pyqtchart安装对应版本,这里是5.15.0使用清华源
pip install PyQtChart==5.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
安装时二者须对应版本,不然pyqtchart可能无法使用
查看pyqt5与pyqtchart是否安装
pip3 show pyqt5
pip3 show PyQtchart
安装pyqt-stubs使得pyqt有代码提示
pip show PyQt5-stubs
参考文章