Error in input file: not well-formed (invalid token): line 1, column 0 when trying to export a .ui file to a .py file
-
wrote on 31 Jul 2024, 01:04 last edited by
Hey,
Im quite new to creating GUI's and I'm working on a project where I need one. I created a ui.qml file, then went ahead and saved it as an .ui file. I then proceeded to use thepyuic5 -x test.ui -o test.py
command to convert the .ui file into a .py file. After executing I got greeted with an error message saying "Error in input file: not well-formed (invalid token): line 1, column 0".
I also tried not converting the .ui file and using
from PyQt5 import uic and uic.loadUi('test.ui', self)
in a python file in hopes to fix it, but it didnt work either. I pretty much got the same error that way only this time it was worded a bit differently, "xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0".
Does anyone know a possible fix for my situation?
For reference:- System is a M1 Macbook pro 2020
- Python version: 3.11.7
- PyQT5 version: 5.15.10
-
Hey,
Im quite new to creating GUI's and I'm working on a project where I need one. I created a ui.qml file, then went ahead and saved it as an .ui file. I then proceeded to use thepyuic5 -x test.ui -o test.py
command to convert the .ui file into a .py file. After executing I got greeted with an error message saying "Error in input file: not well-formed (invalid token): line 1, column 0".
I also tried not converting the .ui file and using
from PyQt5 import uic and uic.loadUi('test.ui', self)
in a python file in hopes to fix it, but it didnt work either. I pretty much got the same error that way only this time it was worded a bit differently, "xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0".
Does anyone know a possible fix for my situation?
For reference:- System is a M1 Macbook pro 2020
- Python version: 3.11.7
- PyQT5 version: 5.15.10
@shinic Open the ui file in a hex editor and check what is right at the beginning of the file.
-
wrote on 31 Jul 2024, 08:43 last edited by friedemannkleint
You are mixing up QML and QtWidgets ;-) .ui.qml files are for use with QQmlEngine, , see QML vs widets .
1/3