On the internet to see a lot of Ubuntu system installed PYQT5, feel a little trouble.
The main library has only one: PYTHON3-PYQT5
Can be installed by a new installation or by a shell command
sudo Install PYTHON3-PYQT5
You can use it after installation. Design the form, and then the next Qtdesinger.
One of the simplest small examples: show a form
#!/bin/env Python3#-*-coding:utf-8-*-ImportSYS fromPyqt5.qtwidgetsImportqapplication, Qwidget #导入相应的包if __name__=='__main__': App=qapplication (SYS.ARGV) #创建QApplication对象是必须, management of the entire program, parameters are optional, some words can receive command line parameters W=qwidget () #创建窗体对象, w.resize (250, 150) #设置窗体大小w.move (100, 300) #设置在屏幕上的显示位置w.setwindowtitle (' Simple') #设置窗口标题w.show () #窗口显示sys.exit (app.exec_ ())
Sys.exit (APP.EXEC_ ()) Finally, we create a loop (Mainloop) of this application principal, which begins to process "events", which receive events from the window interface and assign them to the application's Widget object. If we call the exit () method, the window's body loop ends and the in-Memory widget object is destroyed, and the Sys.exit () method ensures the reliability of exit and cleanup, and the system environment is told how the application should end.
Install Pyqt5 under Ubuntu