2

I have been getting a bit of an odd error when starting QGIS concerning the loading of one of my own plugins

Traceback (most recent call last):
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 219, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "E:\GitHub\QDriller\QDrillerPlugin\__init__.py", line 34, in classFactory
from .qdriller import QDriller
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "E:\GitHub\QDriller\QDrillerPlugin\qdriller.py", line 27, in 
from qdriller_dialog import QDrillerDialog
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "E:\GitHub\QDriller\QDrillerPlugin\qdriller_dialog.py", line 417, in 
os.path.dirname(__file__), 'sectionview_base.ui'))
File "G:\OSGEO4~1\apps\Python27\lib\site-packages\PyQt4\uic\__init__.py", line 213,in loadUiType
exec(code_string.getvalue(), ui_globals)
File "", line 219, in 
File "G:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named resources_rc

Now usually this would be because there is a mismatch in the name of the resources module called in the main plugin module (qdriller.py).

However, i have called my resources module 'resources', both in the code and the plugin directory. All my gui elements work and the resources are present (and have been changed and recompiled since first getting the error), and the plugin runs when reactivated using the plugin manager once QGIS is running.

This error occurs regardless of what the import call/resources file are called, i have tried "resources", "resources_rc", "foobar" etc. All cause the error but in all cases the gui and resources still work

This is also the case across 3 different installs of 2.8 and 2.8.1

  • Have you read this? gis.stackexchange.com/questions/139625/… – Germán Carrillo Apr 15 '15 at 2:33
  • @gcarillo yes I have, that was one of the few things Ive found that is close and had a good look at it, thats what caused me to look into all the different names. However, a difference I can see is that his was failing to import a module he was calling. In my case, none of my code calls for "resources_rc", thus im not sure why it it is trying to find such. I have also successfully used all the contained resources in my plugin, regardless of its name, which the other OP didnt seem to. – valheran Apr 15 '15 at 2:55
  • Also, not sure if it is clear in the OP, but this error doesnt prevent the plugin working, it just trips up at the "restoring loaded plugins" in QGIS startup (which doesnt complete until error has been acknowledged), and the plugin has to be manually reloaded from the Plugin Manager – valheran Apr 15 '15 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.