This I think is a clue. When you get no module named (name of a dependency, e.g cv2), it relates to requirements.txt.
The module (name of the plugin) wouldn’t be declared in requirements.txt anyway, so even if the error looks similar, I think the cause is different!
1. Hypothesis about where the error happens
Looking at the same example as before, I don’t see any place where I would expect to import (name of the plugin) or from (name of the plugin) import *. Instead, it seems conventional to use from .plugin import * and a plugin.py file inside the plugin package itself.
That makes me think that the error happens outside of your plugin, when some ODM / WebODM code tries to import it. (Given your screenshot, the logs don’t seem to include the location where the error happened, besides saying worker, so we can’t really confirm that.)
2. Why would the new error happen once import cv2 succeeds, though?
If it’s a different error/cause than the no module named 'cv2', then I’d ask myself: did we solve that one, and is this the next step?
In other terms: if two imports where to fail for whatever reason, why would importing a dependency fail first, if importing the plugin was going to fail as well. Why would we try to import the dependency before trying to import the plugin?
I am not sure about that… thinking aloud: if the plugin was not found, the import cv2 would have no reason to be interpreted at all, so we wouldn’t see it fail… I think… but if the plugin was found, then I don’t see why importing the plugin’s package would fail (that is the file (name of the plugin)/__init__.py).
(I feel like I’m making a mistake / missing something.)
We can test a part of my reasoning:
- If you rename the directory of your plugin, do you get an error that says
no module named (new name)?
- If you remove the
requirements.txt file from your plugin, do you get no module named 'cv2' again?
By the way, it looks like the G. Drive link is not publicly accessible. But I’m not sure you actually want it to be publicly accessible? We should be able to figure this out without the code anyway, no pressure from me on that!