[Qgis-user] Plugin Reloader plugin making trouble

b.j.kobben at utwente.nl b.j.kobben at utwente.nl
Fri Mar 22 07:52:19 PDT 2019


He Yoann and the Plugin Reloader author

Thanks for finding that. I can confirm it was the same problem in my case. Also tested and found that renaming the folder the plugin files are in (in my case from <plugin name> to folder_<plugin name> ) solves the problem just as well.

I do consider this a workaround to what actually is  a Plugin Reloader bug, as the "normal" setup is the folder having the same name as the plugin itself – that's also the way that the Plugin Builder delivers the "examples plugin"...

I actually found that a bug was filed for this (but for some strange reason closed without having been solved), so I commented on that in the bug tracker (https://github.com/borysiasty/plugin_reloader/issues/20)

yours,
--
Barend Köbben


On 22/03/2019, 15:18, "Yoann QUENACH" <yquenach at itlink.fr<mailto:yquenach at itlink.fr>> wrote:

Hi Barend,

I encountered the exact same problem no too long ago: plugin works fine, but as soon as I try to reload it using PluginReloader, this annoying import error occurs.
My problem was the plugin python file had the same name as its containing folder (which should not be a problem, but causes weird relative import errors with PluginReloader), so a quick fix was to rename the python file with a _plugin suffix.

So this layout fails:

<pluginname>
|-----  __init__.py
|-----   <pluginname>.py  <---- relative import inside
|-----   otherfile.py
|-----   ...

while this one does not

<pluginname>
|-----  __init__.py
|-----   <pluginname>_plugin.py  <---- relative import inside
|-----   otherfile.py
|-----   ...

I can only assume that PluginReloader does not correctly clean up everything while reloading plugins...

Le mar. 19 mars 2019 à 15:43, <b.j.kobben at utwente.nl<mailto:b.j.kobben at utwente.nl>> a écrit :
Hi all,

as a follow-up to my earlier question (below), I have now embarked on the slow (but fun!) process of learning how to create a Python Processing Plugin. I have successfully build a skeleton one using the Plugin Builder, managed to get my PyCharm IDE to work with the qgis.core library and thus can get to developing my own.

However, I keep having to uninstall my plugin, quit Qgis, deploy a new version to the plugins dir and then re-start Qgis, which works fine, but is a bit of a pain. I have to do this because the Plugin Reloader keeps failing to reload it "in place" with the message:

"2019-03-19T15:25:42     WARNING    Traceback (most recent call last):
              File "/Applications/QGIS3.4.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 309, in loadPlugin
              __import__(packageName)
              File "/Applications/QGIS3.4.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 672, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "/Users/barendkobben/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/origin_destination_points_to_flow_lines/origin_destination_points_to_flow_lines.py", line 38, in
              from .origin_destination_points_to_flow_lines_provider import OriginDestinationPointsToFlowLinesProvider
              File "/Applications/QGIS3.4.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 672, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
             ImportError: attempted relative import with no known parent package"

This seems strange, because when loading it the first time there is no problem with "no known parent package". Can anybody tell me why this happens (and how to solve it  hopefully)...?


--
Barend Köbben

On Thu, 14 Mar 2019 at 00:51, <b.j.kobben at utwente.nl<mailto:b.j.kobben at utwente.nl>> wrote:

Hi all,

Many of my students used the FlowMapper plugin to create flowmaps from Origin-Destination data. Unfortunately development has stopped in may 2016 and therefore a GQIS 3.x compatible version never came. From the plugins page at https://plugins.qgis.org/plugins/FlowMapper/ and the github repository at https://github.com/cempro/flowmapper I cannot seem to find anything on the developer (other then his 'cempro' moniker).

Does anyone know of the status of this plugin, if an alternative is available, or any other useful info?

yours,
Barend Köbben

_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--


[Image removed by sender.]<https://www.itlink.fr/>




Yoann Quenach de Quivillic

Ingénieur d'étude



www.itlink.fr<https://www.itlink.fr/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190322/baed789e/attachment-0001.html>


More information about the Qgis-user mailing list