i am trying to install and import cv2 with many ways but i can't i am using python 3.12.1 and all the posts in stack overflow to fix it but i can't fix
i try:
python -m pip install cv2
and:
pip install opencv-python
>>> import cv2
Traceback (most recent call last):
File "c:\Users\Admin\Music\file\nhandienkhuonmat.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
I just tried running these on my machine:
pip3 install opencv-python
python3 (to open python interactive terminal)
import cv2
and everything works on my end.
So a few things could be the issue for you.