I wanted to try the simple code which was supposed to convert text to video like this
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
#more lines of code follow
I tried moving cv2.so around in my source code folder and everywhere. I tried even uninstalling and re-installing opencv then running this code over and over again. My terminal on VSCode gets terminated by error No module named cv2 - none of my efforts helped. I am about to bang off my keyboard out of frustration.
This command line gave me this output opencv-python 4.12.0.88
I just tried running a python code with cv2 but still got no module named cv2.. No idea what went wrong here
After putting cv2.so back, I’d also check if you’re using the right python executable to run your script. Are you using a miniconda environment? That’s always the recommended way of managing dependencies like opencv and torch.