pyuic5.exe doesnt output anything and clears the input file

1.1k views Asked by At

This is a small test that im trying to convert to python code via pyuic5:

https://pastebin.com/rBDKhvCV

When using the pyuic5.exe from the Scripts folder in my Venv like this:

(Test) C:\Users\Administrator\Documents\Test\Repo>..\Scripts\pyuic5.exe -o Test.ui QtOutput.py

I get this output:

Error in input file: no element found: line 1, column 0

Afterwards, QtOutput.py is still empty, but Test.ui no longer contains the "designer code", but instead only this:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'QtOutput.py'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

What is this? Why isnt it working? Im doing everything exactly like the online documentation says, i think? (using what the people at https://python-forum.io/Thread-Convert-ui-file-py said)

Thanks in advance!

1

There are 1 answers

1
olinox14 On BEST ANSWER

The correct use of pyuic is:

pyuic5 -o target_py_file.py my_ui_file.ui

You're currently telling to pyuic to process the QtOutput.py file and to write the output in the Test.ui file.

The -o option stands for 'output'