4

I developed my first plugin to QGIS and I want to upload it, but... to do this I have to change information about plugin (like description/add code repo link and bug tracker link) and that's where my problem comes in. I update my metadata.txt file, but doing so I cause an error. In plugins repository: "This plugin is broken. Error reading metadata." When I reload plugin:

Traceback (most recent call last):
  File "D:/Programy/QGIS/apps/qgis/./python\qgis\utils.py", line 364, in unloadPlugin
    _unloadPluginModules(packageName)
  File "D:/Programy/QGIS/apps/qgis/./python\qgis\utils.py", line 375, in _unloadPluginModules
    mods = _plugin_modules[packageName]
KeyError: u'<my_folder_cointains_plugin>'

but the weirdest thing is that plugin is working perfectly.

Maybe there is a better way to update info about plugin instead of modify metadata.txt file?

0

3 Answers 3

6

In addition to axel_ande awnser:

This error seems to occur whenever the metadata.txt is illformed!

That might be also the reason why using the PluginBuilder helped for DIV in his awnser because the automatically generated metadata.txt is valid.

Possible trap holes (be free to add more):

  • missing required entries. see here
  • tag separation is , only! Without spaces. Spaces are only allowed within a tag. (valid = tag=foo,bar | valid tag=foo bar,foo2 | invalid tag=foo, bar) (this was my case)
  • changelog on multiple lines (even thou it should be possible this might be a problem)
1

For those, who have the same issue.

So, I didn't solve the problem itself, but found a workaround.

  1. Make another one plugin (I use "Plugin Builder").
  2. Make sure you put the same data as your main plugin has in "Class name" and "module name" fields. The rest fields is up to you.
  3. Copy all files from main plugin to the new one (I did not include "resources.py" - not sure is that necessary). Then go to OSGeo4W shell and navigate to your new plugin folder. Then type:

pyrcc4 -o resources.py resources.qrc

And that's it.

0

I had a similar problem with my plugin, my problem was that I've written my changelog on several rows instead of one after the " = "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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