How to Install Pyqt for Python 3 in Ubuntu 14.10?
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...
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?
4 Answers
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
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:
/usr/bin/designer
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
- Install
python3. - Install
sip. - Install
python3-pip. - Run the command:
pip3 install pyqt5
Well, I documented the steps for Installing pyqt5 with qt designer and code generation here:
With this you can generate the code from Qt Designer itself.
Must Read
Installation
pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools