Problem loading Qt Designer plugins from different directories

Ivan Sinkarenko ivan.sinkarenko at
Thu Aug 20 15:25:43 BST 2020

Hi Phil,

I've found a bug in loader, namely inside 

1. Consider having 2 plugins in separate directories: 
/path/to/first/; /path/to/second/, and loading 
that into Qt Designer simultaneously, e.g. 
2. PyCustomWidgets::importPlugins function will be called twice with 
arguments ("/path/to/first", "my_plugin") and ("/path/to/second", 
3. The first argument (paths) are added to sys.modules
4. The second argument is given to PyImport_ImportModule. But because 
both are named "my_plugin", only the first plugin will be loaded. The 
second time it will skip import, as Python always does to modules.
5. In Qt Designer, you will find 2 entries of the same plugin under 
Help->"About Plugins".

Not too critical (as can be circumvented by always having unique 
filenames), but was quite unexpected to find.


More information about the PyQt mailing list