I tried a course on Face Detection using OpenCV and I got stuck on the first step itself because after running the test code, PyCharm shows ModuleNotFoundError: No module named 'cv2'. However I have installed OpenCV successfully using pip install opencv-contrib-python
and my pip has been updated to the latest version.
I'm using Windows 10 (64 bits)
Python Version: 3.9.6
Numpy Version: 1.21.1
OpenCV Version: 4.5.3.56
Pip Version: 21.2.2
Code to print the 3D Matrix of a colored image:
import cv2
img = cv2.imread("C:\\Users\\bibhr\\PycharmProjects\\pythonProject2\\lfc.jpg",1)
print(img)
Error Message:
ModuleNotFoundError: No module named 'cv2'
Image for pip list
:
enter image description here
I have tried uninstalling and reinstalling Python and OpenCV but none of that worked Any help would be appreciated as I need to finish this project in a couple of weeks.
Also, I couldn't find cv2.so
file in C:\Users\bibhr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cv2
Is that the reason? If yes, then how do I find cv2.so
in my computer? (The search box couldn't find it either)