4

I have a plugin that I have developed for work and we have less than 10 users that will want to use it, so rather than publishing on the QGIS online plugin repository (https://plugins.qgis.org/plugins/), I thought I could zip the plugin directory and disseminate that instead, making use of the 'INSTALL from ZIP' option on the plugin manager in QGIS.

I thought it would be as simple as zipping the directory containing the plugin code and simply pointing to that file, but I'm getting a 'ModuleNotFoundError':

Couldn't load plugin 'datacube_qgis_plugin/.git' 

ModuleNotFoundError: No module named 'datacube_qgis_plugin/' 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python\qgis\utils.py", line 312, in loadPlugin
    __import__(packageName)
  File "C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python\qgis\utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'datacube_qgis_plugin/'

My directory structure looks like:

datacube_qgis_plugin.zip 
                   |--- > datacube_qgis_plugin/ 
                                              |---> .py files etc.

Is there an exact method for 'zipping' a plugin for QGIS import?

ADDITIONAL INFO - If I exit the box displaying the error above, it then proceeds to say 'plugin installed successfully' - so why the error?

1

Try deleting the .git folder.

I recently got the same error because of a .idea folder which I think was a leftover from some python ide I used at some point. You probably don't need the .git folder for distribution.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.