Search code examples
pythonuser-interfacepyqt5qt-designer

Convert a .ui file to .py file with PyQt5 and python 3.6


Converting a .ui file to a .py file using cmd

C:/Python36/Lib/site-packages/PyQt5/pyuic.cpython-36.pyc -x mainwindow.ui -o mainwindow.py

The error shows like

The system cannot find the path specified.

I checked the path, unfortunately, there is no file named in the PyQt folder

please, someone, check this problem


Solution

  • I found an answer to the above

    first, we need to locate the pyuic5.exe file and copy your ui file to the same location. then, we have to create a command prompt and give the command will give the python file .

    pyuic5.exe mainwindow.ui -o mainwindow.py -x