Suggested way to handle conflicting modules like opencv and opencv-contrib? #708
Replies: 1 comment 1 reply
-
Oh, this is a tricky issue. This is also connected to this problem. This is also connected to the issue where it's unclear which opencv package will actually be imported when multiple opencv packages are installed. The situation I encountered was that both Since each has different requirements, fixing this to one specific package is inappropriate. To resolve this situation, it seems necessary to allow the user to choose via a prompt or something similar. As a last resort, you can solve it directly through It is also necessary to consider cases where the dependency on the cv package is indirectly introduced by another package. This seems to require a discussion. |
Beta Was this translation helpful? Give feedback.
-
I want to add a edge drawing preprocessor which requires
opencv-contrib-python
. but as the official docu states:https://pypi.org/project/opencv-python/#installation-and-usage
If any non-contrib module is installed I get errors like
AttributeError: module 'cv2.ximgproc' has no attribute 'createEdgeDrawing'
. all packages are installed in the same environment as ComfyUI, so if any custom node down the line installs a non-contrib module, everything breaks.What is the official way to handle these modules in the ecosystem?
I just stumbled upon the pip_overrides.json feature but this is a user settings and cannot be enforced by a custom node (for good reasons, but seems like it should be a default in Comfy-Manager or ComfyUI).
related discussion in official opencv-python: opencv/opencv-python#987 (comment)
Beta Was this translation helpful? Give feedback.
All reactions