Currently, the repl is hosting the dev branch of a closed-source tech, so I cannot share it. However, there is really no code issue; the error is thrown on line 3 of the file, which is only “import cv2”
The issue seems to be with how OpenCV-Python is installed. I’ve tried in both Python and Nix repos without success.
I installed opencv-Python using pip, which is how I first got the issue. I next tried the packages tab, and finally using poetry. All of these gave the error described.
I’ve actually now got it working by forking another OpenCV repl, and adding my code there. Doing more research, I’m thinking the bug was caused since my entry point wasn’t in the project root, so maybe OpenCV had issues with that…
I think the issue is related to the change of Python template. If you fork an older OpenCV project it seems to work - or at least it gets you further into the code before there is an issue.