Home » How to convert ui to py pyqt5

How to convert ui to py pyqt5

Let’s start the discussion about How to convert ui to py pyqt5 in following methods.


Convert ui to py pyqt5 using conda

Instead than manually installing Python packages, I would suggest utilising conda and pip from a recent Anaconda. Open a privileged (Run as Administrator) cmd or git bash after installing Anaconda with Python 3.6 and run the following commands:

Installing PyQt5

For Python 3.6, the default is PyQt5. You can perform a search to see what packages are available using conda search pyqt

conda install pyqt

Generating .py file from .ui

Run the below command to convert the .py file from the .ui file.

python -m PyQt5.uic.pyuic -x [FILENAME].ui -o [FILENAME].py

Alternative : convert .ui file to .py using pyqt5 module

For pyQt5 version use:

pyuic5 -x main.ui -o main.py

For pyOt4 version use:

pyuic4 -x main.ui -o main.py

I hope the strategies listed above work for you. Happy coding and come back again.

Similar Post : Firewall not enabled (skipping reload)