Python3.8
version: Python3.8
PyQt5 5.15.1
Anaconda has been installed
finds the article by following the steps:
pip3 install Sip
pip3 install PyQt5
pip install PyQt5-tools -i http://pypi.douban.com/simple –trusted-host=pypi.douban.com
adds pyqt5-tools to the global environment variable (Path). Mine is:
C:\Users**\AppData\Local\Programs\Python\ python38-32 \Lib\site-packages\pyqt5_tools
test code
import sys
from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
widget = QtWidgets.QWidget()
widget.resize(360, 360)
widget.setWindowTitle("hello, pyqt5")
widget.show()
sys.exit(app.exec())
:
: this application failed to start because no Qt platform plugincould be initialized may fix thisproblem
reinstalled PyQt5 also not
qt_qqpa_platform_plugin_path
C:\Users**\AppData\Local\Programs\Python\ python38-32 \Lib\site-packages\PyQt5\Qt\plugins
and then restart the computer, to take effect, appear successful problem solving
reference articles:
https://www.cnblogs.com/yclizq/p/11192128.html
https://blog.csdn.net/zjm12343/article/details/79707275?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param& depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param