AttributeError: module 'PyQt6.QtQml' has no attribute 'QQmlExtensionPlugin'

Kyle Altendorf sda at fstab.net
Wed May 12 21:29:45 BST 2021


Hi,

I'm working on adding Qt6 support to the pyqt-tools family of packages 
and am running into issues with QML plugins.  I get an error that seems, 
so far, to be coming not from my code.

   AttributeError: module 'PyQt6.QtQml' has no attribute 
'QQmlExtensionPlugin'

Searching the PyQt6 6.1.0 source for QQmlExtensionPlugin I get the 
following hits.

   
PyQt6-6.1.0/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py:from 
PyQt6.QtQml import qmlRegisterType, QQmlExtensionPlugin
   
PyQt6-6.1.0/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py:class 
ChartsPlugin(QQmlExtensionPlugin):
   
PyQt6-6.1.0/qmlscene/pluginloader.cpp:PyQt6QmlPlugin::PyQt6QmlPlugin(QObject 
*parent) : QQmlExtensionPlugin(parent),
   PyQt6-6.1.0/qmlscene/pluginloader.cpp:    // Get QQmlExtensionPlugin.  
We do this after the import of the plugin to
   PyQt6-6.1.0/qmlscene/pluginloader.cpp:            
"QQmlExtensionPlugin");
   PyQt6-6.1.0/qmlscene/pluginloader.cpp:    // QQmlExtensionPlugin.
   PyQt6-6.1.0/qmlscene/pluginloader.cpp:                "%s does not 
contain an implementation of QQmlExtensionPlugin",
   PyQt6-6.1.0/qmlscene/pluginloader.h:#include <QQmlExtensionPlugin>
   PyQt6-6.1.0/qmlscene/pluginloader.h:class PyQt6QmlPlugin : public 
QQmlExtensionPlugin
   PyQt6-6.1.0/ChangeLog:  Removed the internal QQmlExtensionPlugin 
class.

I notice the last hit is the changelog entry saying that 
QQmlExtensionPlugin has been removed.  Yet, it is still referenced twice 
in `pluginloader.cpp`.

Is this a sufficient report or do I need to make up a minimal 
reproduction?  The apparent conflict between the source and the 
changelog seemed like it may be sufficient.  Maybe at least to lead to 
an explanation or resource I should read.

Thanks as always.

Cheers,
-kyle


More information about the PyQt mailing list