Home > Article > Development Tools > A brief discussion on how to build and configure the PyQt5 environment in VSCode
How to build and configure the PyQt5 environment in
VSCode? The following article will introduce to you the installation of the PyQt5 toolkit and the method of configuring the PyQt5 environment in VSCode. I hope it will be helpful to friends in need!
Record the process of setting up the environment when learning QT. As far as I know, there is a python version and a C version for QT interface programming. The one I chose here is the python version of PyQt5
is already installed by default. Python environment
Use the pip command to install the PyQt5 tool——pip install pyqt5
Then install the development tool QT designer——pip install pyqt5- tools
The installation path is \Lib\site-packages under your python installation path
Find the pyqt5designer.exe file under this path
This is the Qt Designer graphical interface development tool. You can choose to generate a shortcut to the desktop, and then double-click it to use it.
Visual Studio Code only requires two steps. [Recommended learning: "vscode introductory tutorial"]
Download and install the plug-in PYQT integration
Set the path of pyqt5designer.exe as the default opening location
Click the gear in the lower left corner to open the settings, search for pyqt directly, open the PYQT integration configuration in the extension, and find Pyqt integration Pyuic: Cmd As well as the two options of Pyqt integration Qtdesigner Path, just add the absolute path of the previous pyqt5designer.exe (I moved it to another location here)
You can directly use pyqt5designer for layout, or code your own code for design.
Using pyqt5designer: You can directly double-click pyqt5designer.exe to open the development tool (if you have generated a shortcut before)
In order to keep the desktop clean, I did not generate it, but To use the plug-in you just installed, you can quickly open the development interface by right-clicking PYQT: new form in the file bar on the left
##Then add a control and save a .ui file Return to vscode, open the corresponding folder, click on the .ui file, right-click and select PYQT: Compile Form , generate the corresponding .py file. This is the corresponding py code for the layout you just designed. Beginners like me can use this to learn the layout code.
. Later, I found a solution in [Muzi Huaner]'s article (https ://blog.csdn.net/muzihuaner/article/details/106205930)
Create a new .pylintrc file and enter the following code, the problem will be solved perfectly
vscode tutorial! !
The above is the detailed content of A brief discussion on how to build and configure the PyQt5 environment in VSCode. For more information, please follow other related articles on the PHP Chinese website!