ModuleNotFoundError: No Module Named ‘CV2’

Get in Touch With Us
Submitting the form below will ensure a prompt response from us.
The error “ModuleNotFoundError: No module named ‘cv2′” occurs when Python cannot find the OpenCV library. OpenCV (cv2) is a powerful computer vision library used for image and video processing.
Fix: Install OpenCV
1. Install via pip (Recommended)
Run the following command in your terminal or command prompt:
pip install opencv-python
If you need extra features like SIFT, SURF, or other advanced functions, install:
pip install opencv-contrib-python
Make sure you are using the correct Python environment if you have multiple versions installed.
2. If You Are Using Anaconda
Use the following command:
conda install -c conda-forge opencv
3. Verify Installation
After installation, check if OpenCV is correctly installed by running:
import cv2
print(cv2.__version__)
If this prints the OpenCV version without errors, the installation is successful.
4. If the Issue Persists
Try upgrading pip before reinstalling OpenCV:
pip install –upgrade pip
- Ensure you are running Python in the correct virtual environment.
- If using Jupyter Notebook, restart the kernel after installation.

About Author
Bhavik Koradiya is the CEO / Co. Founder of Silver WebBuzz Pvt. Ltd. Having 18+ years Experience in LAMP technology. I have expert in Magento, Joomla, WordPress, Opencart, e-commerce and many other open source. Specialties: Magento, WordPress, OpenCart, Joomla, JQuery, Any Open source.