Pycharm installation tutorial

1. Download PyQt

Official website: http://www.riverbankcomputing.com/software/pyqt/download5

My OS is 64-bit and installed Python3.4.3, so I choose to download: PyQt5-5.4.1-gpl-Py3.4-Qt5.4.1-x64.exe

Just click install.

 

After PyQt5 is installed, you need to modify the system variables

QT_QPA_PLATFORM_PLUGIN_PATH
C:\Python34\Lib\site-packages\PyQt5\plugins <<----------------- This is where my PyQt5 plugins folder is located

2. Configure PyCharm

1) Open PyCharm, execute the shortcut key ctrl+alt+s to open the setting interface, enter tool, click on external tools, and configure qtdesigner.

Click the plus sign in the upper left corner to configure as follows:

In the settings of Qt Designer, Program selects the path of designer.exe in the PyQt installation directory

Work directory uses the variable $FileDir$ (click the Insert macro button behind to double-click on the screen without entering)

2). Set "PyUIC" -- this is mainly used to convert the Qt interface into py code

In the settings of PyUIC, everything else is similar, Program writes the address of Python, Parameters writes

-m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py

Just change the above Python path to your own!

Work directory uses the variable $FileDir$

When using, first generate the ui file with QtDesigner, and then use PyUIC to convert the ui file into the corresponding python file

 

 

-------------------------------------------------- ---Gorgeous dividing line-------------------------------------------- -------------------------

Recently, the resource file has been used. The resource file needs to be transcoded with pyrcc5.exe. The configuration method is as shown in the figure.

Pit encountered in pyqt5 installation

  1. Pit 1: pip install pyqt5 is not enough!
    In addition to this you also need to pip install pyqt5-tools
    The best way is to pip install pyqt5 pyqt5-tools directly
  2. Pit 2: I don't know where the pyrcc5.exe file is located. I
    don't know if it is a version problem or something else. It is not said by many great gods on the Internet. It is in pyqt5-tools, and of course, it is not in pyqt5. Actually, it is placed in Python\Python35\Scripts (note that 35 is just my python version number)

If you can see this article of mine, it can actually be assisted by some tutorials on the Internet, and it is very easy to complete.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325171568&siteId=291194637