It can be downloaded from the official website of PyQt5 , but it is more convenient to install online with pip install
Win+R, enter cmd to enter DOS, and add "-i https://pypi.douban.com/simple" after it to use the image provided by Douban:
pip install PyQt5 -i https://pypi.douban.com/simple
Then enter the command to download the graphical interface development tool qt designer, the translation tool liguist and other tools:
pip install PyQt5-tools -i https://pypi.douban.com/simple
After installation, we set the environment variables of pyqt5-tools, mine is:
D:\python\Lib\site-packages\pyqt5-tools
It should be very simple to configure system environment variables. You should also configure it when you learn java.
Then open python IDLE to edit the code:
import sys from PyQt5 import QtWidgets, QtCore app = QtWidgets.QApplication(sys.argv) widget = QtWidgets.QWidget() widget.resize(360, 360) widget.setWindowTitle("hello, pyqt5") widget.show() sys.exit(app.exec())
Click F5 to run, if the following interface appears, the PyQt5 environment has been successfully installed:
Enter import PyQt5 in IDLE, if there is no error, it means that PyQt5 is installed successfully
Finally, we edit the following code in python IDLE to form an API document on the E disk:
import sys from PyQt5.QtWidgets import QWidget out = sys.stdout sys.stdout = open(r'E:\QWidget.txt', 'w') help( QWidget ) sys.stdout.close() sys.stdout = out