Using QtCharts in a Pyside6 Application
-
Hi,
I want to use "QtCharts" in my Pyside6 QtQuick app. If I try to import the QtCharts qml module, it prompts me:
QML module not found
:QML module not found (QtCharts). Import paths: C:/Qt/Tools/QtCreator/bin/qml For qmake projects, use the QML_IMPORT_PATH variable to add import paths. For Qbs projects, declare and set a gmllmportPaths property in your product to add import paths. For qmiproject projects, use the importPaths property to add import paths. For CMake projects, make sure QML IMPORT_PATH variable is in CMakeCache.txt For qmlRegister... calls, make sure that you define the Module URI as a string literal.
I also tried additionally adding this import in my
main.py
file. The import works,and the app runs but doesn't make it so the QML import works:from PySide6.QtCharts import QChart, QLineSeries, QChartView
I checked the
Qt Maintenance Tool
, and QtCharts seemed to be checked forQt6.9
.
I also checked my Python 3.13.1 interpreters libraries, and PySide6.QtCharts seems to exist within these paths"C:\Users\USER\AppData\Roaming\Python\Python313\site-packages\PySide6\qml\QtCharts" "C:\Users\USER\AppData\Roaming\Python\Python313\site-packages\PySide6\Qt6Charts.dll" "C:\Users\USER\AppData\Roaming\Python\Python313\site-packages\PySide6\Qt6ChartsQml.dll"
I still can't get the chart working in qml, does somebody know what is going on?