Solved QML module not found
-
Hello every, when I try to import qtquick window element in python environment, I come across the following error :
QML module not found(QtQuick.Window)
However, in c++ environment, everything goes fine, could anyone give me some clue? Thanks in advance!
Add: It seems that we have to configure .pyproject to include qml module path, but how? -
@small_bird Could be that Qt packaged with your PyQt (PySide? you didn't specify what you're actually using) does not have that module.
-
@jsulm I try to use qtquick window
-
@small_bird said in QML module not found:
I try to use qtquick window
I know, you already explained that...
-
@jsulm i create a qml file in which to import qtquick model,but failed, strange!!it works well in cpp environment
-
@jsulm in the cpp environment, i configure qml direcory in pro file,but in Python, where to?
-
@small_bird said in QML module not found:
but in Python, where to?
I don't know since I do not use Qt with Python. Did you check PyQt/PySide (you still did not say which one you're using!) documentation?
-
@jsulm i am using pyqt5
-
@small_bird As long as nobody else is answering here I suggest to check PyQt documentation (especially QML part).
-
@jsulm where is the link ,could offer me?thanks a lot!
-
@small_bird Did you try to search for it by yourself? Is not hard to find.
https://www.riverbankcomputing.com/static/Docs/PyQt5/ -
@jsulm Yes, i have checked that, but the qml-python part is too simple, hope there is other information. I have googled for long time!!!
-
@jsulm whereis the explation of ".pyproject" file?
-
@small_bird https://doc-snapshots.qt.io/qtcreator-4.11/creator-project-creating.html says it is JSON, but I do not have more information. You could search for examples (some PyQt projects with .pyproject file).
-
@jsulm Thanks a lot, problem solved! I open two qml projects(one is cpp other is python) together which cause the problem.
-
@small_bird said in QML module not found:
problem solved!
So don't forget to mark your post as such!