pyside6-project.exe existed with code 1
-
Qt Creator can't build my project. But when I run the app from the console, it works as expected.
I tried to remove pycache and clean and rebuild. It didn't work.
I believe there is another cache somewhere that I need to clean but I don't know.
05:42:48: Starting: "D:\uprojects\projects\self\qt-for-python\pyside6\Scripts\pyside6-project.exe" build Traceback (most recent call last): File "D:\uprojects\projects\self\qt-for-python\pyside6\Lib\site-packages\PySide6\scripts\metaobjectdump.py", line 389, in <module> json_data = parse_file(file, context, args.suppress_file) File "D:\uprojects\projects\self\qt-for-python\pyside6\Lib\site-packages\PySide6\scripts\metaobjectdump.py", line 349, in parse_file visitor.visit(ast_tree) File "F:\bin\python\python397\lib\ast.py", line 407, in visit return visitor(node) File "F:\bin\python\python397\lib\ast.py", line 415, in generic_visit self.visit(item) File "F:\bin\python\python397\lib\ast.py", line 407, in visit return visitor(node) File "D:\uprojects\projects\self\qt-for-python\pyside6\Lib\site-packages\PySide6\scripts\metaobjectdump.py", line 320, in visit_ImportFrom self._handle_import(node.module) File "D:\uprojects\projects\self\qt-for-python\pyside6\Lib\site-packages\PySide6\scripts\metaobjectdump.py", line 324, in _handle_import dot = mod.index(".") ValueError: substring not found JSONDecodeError: running pyside6-metaobjectdump on D:\uprojects\projects\self\progressive_memory\packages\Helpers\main.py: Expecting value: line 1 column 1 (char 0) 05:42:49: The process "D:\uprojects\projects\self\qt-for-python\pyside6\Scripts\pyside6-project.exe" exited with code 1. Error while building/deploying project Helpers (kit: Desktop Qt 6.4.2 MSVC2019 64bit) When executing step "Run PySide6 project tool"
-
hi @SGaist ,
On my Linux, it is working from a path that doesn't contain a directory of 'self'. It gives the same error.
ValueError: substring not found JSONDecodeError: running pyside6-metaobjectdump on /home/ckurdu/Projects/Qt/pyside6/progressive_memory/packages/Helpers/main.py: Expecting value: line 1 column 1 (char 0)
The text encoding of main.py is "utf-8 without bom"
-
I realized that "from Pyside6 import QtCore" making this happen. I don't remember when I added this line. When we create a python class from Qt Creator, it adds this line automatically. Maybe I copied and pasted it wrongly to the main.py.
But why this line creates this problem, I don't know.
-
Can you please paste a minimal Python code snippet that causes pyside6-metaobjectdump to fail?
-
Hello @friedemannkleint
You can create a normal python Qt Qml app and add the below line
from PySide6 import QtCore
Full code
# This Python file uses the following encoding: utf-8 import sys from pathlib import Path from PySide6 import QtCore from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine if __name__ == "__main__": app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() qml_file = Path(__file__).resolve().parent / "main.qml" engine.load(qml_file) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec())
-
Thanks, we can fix this.
-
@friedemannkleint
You're welcome. -