PyQt5 installation tutorial

        This article mainly introduces the pip installation method:

Table of contents

1. Install PyQt5

2. Install PyQt5-tools

3. Configure environment variables

Four, configure QtDesigner

Five, configure PyGUI

6. Open QtDesigner


1. Install PyQt5

1. Install in the command prompt (WIN+X+A) by using the Douban mirror:

Enter pip install PyQt5 -i https://pypi.douban.com/simple and wait for the installation

2. Install PyQt5-tools

pip install PyQt5-tools -i https://pypi.douban.com/simple

 

3. Configure environment variables

Right-click My Computer->Properties->Advanced->Environment Variables (screenshot demonstration below win10)

 

User variable: New -> Variable name: QT_QPA_PLATFORM_PLUGIN_PATH
Variable value: D:\language\python38\Lib\site-packages\PyQt5\Qt5\plugins (variable value depends on the installation location)

System variables: path-> Edit- > Add
Variable value: D:\language\python38\Lib\site-packages\PyQt5\Qt5\plugins (variable value depends on the installation location)

Four, configure QtDesigner

1. Open Pycharm -> File -> Settings -> Tools -> External Tools -> Click the + sign -> Enter QtDesigner

Program: D:\language\python38\Lib\site-packages\qt5_applications\Qt\bin\designer.exe (see the location of your own designer.exe file)

Working directory: $ProjectFileDir$

 

Five, configure PyGUI

1. Open Pycharm -> File -> Settings -> Tools -> External Tools -> Click the + sign -> Enter PyGUI

Program: file location of python.exe

实参:$FileName$ -o $FileNameWithoutExtension$.py

Working directory: $ProjectFileDir$

 

6. Open QtDesigner

The above are the installation steps. After the installation is complete, you can use PyQt happily! 

Guess you like

Origin blog.csdn.net/m0_53324526/article/details/126612220
Recommended