I found some tutorials online for earlier versions of Ubuntu but they didn't seem to work on Ubuntu 14.10; either that or I was doing it the wrong way.

I want to use Qt Designer to design a GUI, use PyQt to covert it to .py, then use it in Python.

What packages do I need to install to do this?


All the tools you need are included in Ubuntu repositories. You must install the package qtcreator, which has an integrated QtDesigner, and the package pyqt5-dev-tools, which provides pyuic5, a utility that generates Python code from .ui files.

sudo apt-get install qtcreator pyqt5-dev-tools
  • 2
    Small note for those that follow. The module is found by importing like import PyQt5 . Apr 12 '16 at 16:28

Run these in a Terminal:

sudo apt-get install python3-pyqt5

sudo apt-get install qttools5-dev-tools

sudo apt-get install qtcreator pyqt5-dev-tools

Run PyQt5 Designer, located at:


Run PyQt5 User Interface Compiler (PYUIC5) to convert .ui to .py

pyuic5 gui.ui -o gui.py

Run PyQt5 Resource Compiler (PYRCC5) to convert .qrc to .py

pyrcc5 images.qrc -o images_rc.py

  1. Install python3.
  2. Install sip.
  3. Install python3-pip.
  4. Run the command: pip3 install pyqt5
  • is it pip or sip? Mar 25 '17 at 6:02
  • 2
    @HafizShehbazAli It may be that sip-dev was intended instead of sip, but pip doesn't make sense here. The Python 3 version of the pip package manager is provided by the python3-pip package which is already separately listed. SIP is related to PyQt. mayur: Can you edit this to include an explanation of how to "install sip" and why? Nov 12 '17 at 17:14
  • I dont think you can install pyqt5 using pip in case of ubuntu
    – S Andrew
    Oct 8 '20 at 9:56

Well, I documented the steps for Installing pyqt5 with qt designer and code generation here: https://gist.github.com/ujjwal96/1dcd57542bdaf3c9d1b0dd526ccd44ff

With this you can generate the code from Qt Designer itself.


pip3 install --user pyqt5  
sudo apt-get install python3-pyqt5  
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools

Configuring to run from terminal

$ qtchooser -run-tool=designer -qt=5


Write the following in /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf


Code Generation

Create uic.py file.


import subprocess
import sys

child = subprocess.Popen(['pyuic5' ,'-x',sys.argv[1]],stdout=subprocess.PIPE)


$ chmod +x uic.py

Create a symlink:

$ sudo ln uic.py "/usr/lib/x86_64-linux-gnu/qt5/bin/uic"

Desktop Entry

[Desktop Entry]
Name=Qt5 Designer

Name[en_US]=Qt5 Designer

[Desktop Action NewWindow]
Name=Open a New Window

save in ~/.local/share/application with .desktop extension

  • where are you putting the uic.py file?
    – markling
    Apr 12 '19 at 0:49
  • I don't think we can do pip3 install --user pyqt5 in ubuntu
    – S Andrew
    Oct 8 '20 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy