First do run these commands inside Terminal/CMD:

conda update anaconda-navigator  
conda update navigator-updater  

Then the issue for the instruction below will be resolved

For windows if you have anaconda installed, you can simply do

pip install opencv-python

or

conda install -c https://conda.binstar.org/menpo opencv

if you are on linux you can do :

pip install opencv-python

or

conda install opencv 

Link1 Link2

For python3.5+ check these links : Link3 , Link4

Update:
if you use anaconda, you may simply use this as well (and hence don't need to add menpo channel):

conda install -c conda-forge opencv
Answer from Hossein on Stack Overflow
🌐
Roboflow
roboflow.com › use opencv › modulenotfounderror: no module named 'cv2'
ModuleNotFoundError: no module named 'cv2' (OpenCV)
The ModuleNotFoundError: no module named 'cv2' code indicates that your Python environment cannot find the OpenCV package.
Discussions

How do I fix the issue moduleNotFoundError: No module named 'cv2' ?
it just seems that u are missing open cv all u need to do is install that it may be different depending on what u are using if u are using automatics repo, then it will probably be done from within the venv u can manually activate it from in cmd (cmd does not open in the folder by default so cd Your/StableDiffusion/path/here) by opening the activate.bat file found in stable-diffusion-webui (root) root\venv\Scripts\activate.batthen u will need to run pip install opencv-python else just install it from cmd with the same command pip install opencv-python More on reddit.com
🌐 r/StableDiffusion
8
1
October 16, 2022
No module named cv2 although opencv has been installed already
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 ... More on discuss.pytorch.org
🌐 discuss.pytorch.org
6
0
September 24, 2025
Issue "ModuleNotFoundError: No module named 'cv2'" although opencv is installed
There was an error while loading. Please reload this page More on github.com
🌐 github.com
15
May 22, 2024
Import error.Module not found error cv2.No module named cv2.Cant install open cv
Hello.I cant install open-cv in python 3.6.I need to import cv2, but i have module not found error: no module named cv2.Sudo apt-get install python-opencv and sudo apt-get install python3-opencv didnt help. pip install opencv-python command dint help too: Building wheel for opencv-python runs ... More on forums.developer.nvidia.com
🌐 forums.developer.nvidia.com
4
0
August 8, 2023
🌐
GeeksforGeeks
geeksforgeeks.org › python › modulenotfounderror-no-module-named-cv2-in-python
Modulenotfounderror: No Module Named 'CV2' in Python - GeeksforGeeks
July 23, 2025 - This error specifies that the Python interpreter cannot find the OpenCV module in the current environment. To resolve this issue we needs to install OpenCV library using pip command.
🌐
Reddit
reddit.com › r/stablediffusion › how do i fix the issue modulenotfounderror: no module named 'cv2' ?
r/StableDiffusion on Reddit: How do I fix the issue moduleNotFoundError: No module named 'cv2' ?
October 16, 2022 -

Normally I would just look up the solution rather than ask but from what I've seen, most people tend to have this issue differently, hence why I needed to ask, but also because I'm completely ignorant on this matter. I don't think I could fix this on my own unless I found an answer that told me how step by step.

Anyway, as I was installing diffusions for the very first time, the cmd kept giving me this issue repeatedly.

Relauncher: Launching...

Traceback (most recent call last):

File "scripts/webui.py", line 18, in <module>

import cv2

ModuleNotFoundError: No module named 'cv2'

As I've said above, since I'm ignorant on this topic, I have no idea what that really means or how to fix it so any help would really be great. I really don't want several hours to be wasted on this lol

🌐
PyTorch Forums
discuss.pytorch.org › torch.package / torch::deploy
No module named cv2 although opencv has been installed already - torch.package / torch::deploy - PyTorch Forums
September 24, 2025 - 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 ...
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
sudo python3 No module named 'cv2' - Raspberry Pi Forums
October 17, 2021 - import cv2 ModuleNotFoundError: No module named 'cv2' 2231puppy · Posts: 25 · Joined: Sat Mar 09, 2019 11:02 pm · Sun Jun 21, 2020 8:56 pm · After you uninstall it, reinstall it with sudo. Code: Select all · sudo pip3 install opencv-python · HATHEMI · Posts: 35 ·
Find elsewhere
🌐
GitHub
github.com › carla-simulator › carla › issues › 7683
Issue "ModuleNotFoundError: No module named 'cv2'" although opencv is installed · Issue #7683 · carla-simulator/carla
May 22, 2024 - Issue "ModuleNotFoundError: No module named 'cv2'" although opencv is installed#7683 · Copy link · Assignees · chris17012 · opened · on May 22, 2024 · Issue body actions · No description provided. Reactions are currently unavailable · PabloVD · No labels ·
Author   carla-simulator
🌐
PyPI
pypi.org › project › opencv-python
opencv-python · PyPI
cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml") ... Before opening a new issue, read the FAQ below and have a look at the other issues which are already open. ... A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries. Q: Pip install fails with ModuleNotFoundError: No module named ...
      » pip install opencv-python
    
Published   Feb 05, 2026
Version   4.13.0.92
🌐
NVIDIA Developer Forums
forums.developer.nvidia.com › robotics & edge computing › jetson systems › jetson nano
Import error.Module not found error cv2.No module named cv2.Cant install open cv - Jetson Nano - NVIDIA Developer Forums
August 8, 2023 - Hello.I cant install open-cv in python 3.6.I need to import cv2, but i have module not found error: no module named cv2.Sudo apt-get install python-opencv and sudo apt-get install python3-opencv didnt help. pip install…
🌐
Python.org
discuss.python.org › python help
Installed opencv but having trouble importing it - Python Help - Discussions on Python.org
April 7, 2024 - Hi all, I recently downloaded anaconda python in order to work on an opencv personal project. I installed opencv using pip install opencv-contrib-python, where it installed successfully. Now, when I type import cv2 in my .py file, I get the following error: ModuleNotFoundError: No module named ...
🌐
Streamlit
discuss.streamlit.io › community cloud
Getting No module cv2 found - Community Cloud - Streamlit
November 2, 2022 - Hi All, I been trying to deploy an app using streamlit. but getting cv2 module not found. pls can anyone help me to sort out this issue
🌐
Fast.ai
forums.fast.ai › part 1 (2018)
AWS p2 instance setup - Error Lesson 1 - ModuleNotFoundError: No module named 'cv2' - Part 1 (2018) - fast.ai Course Forums
November 1, 2017 - Hello everyone, I am using Amazon p2 instance for the lessons. I have installed Anaconda 3.5 version that was suggested by Jeremy. Is there any setup required from software packages perspective ? When I run the Lesson 1 Jupyter notebook, I get the below error.
🌐
Python.org
discuss.python.org › python help
Pip install works but I can't import "Fer and CV2" - Python Help - Discussions on Python.org
August 26, 2023 - Hello, I have PIP installed “fer” and “opencv-python” but I can’t import them. My commands to install are: pip install opencv-python pip install fer These worked. My python code is: import cv2 from fer import FE…
🌐
Ultralytics
docs.ultralytics.com › ultralytics docs › home › quickstart
Install Ultralytics | Ultralytics Docs
November 12, 2023 - See the ultralytics pyproject.toml file for a list of dependencies. Note that all examples above install all required dependencies.
🌐
Core Electronics
forum.core-electronics.com.au › support
Python: import cv2 .. No module named 'cv2' - Support - Core Electronics Forum
January 11, 2026 - pip install opencv-python it says: Successfully installed numpy and opencv-python Good. I then run .py: import cv2 It says: No module named ‘cv2’ What am I doing wrong? :slight_smile:
🌐
Jupyter Community Forum
discourse.jupyter.org › notebook
Cv2 package doesn't work - Notebook - Jupyter Community Forum
June 19, 2024 - I am trying to use the cv2 package on my jupyter notebook that is running in a unique conda environment (I named it MNIST). I have tried the following installs but they don’t work: pip install numpy opencv-python conda…
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
ModuleNotFoundError: No module named 'cv2'ModuleNotFoundError: No module named 'cv2' - Raspberry Pi Forums
February 13, 2024 - The experience you are finding seems to imply the package location is not being pointed to when running outside of MU. ... Are you managing MAIN.PY inside a Virtual Environment as MU seems to recommend? If so, you have to activate the VENV before you can run MAIN.PY with just PYTHON.
🌐
GitHub
github.com › pyinstaller › pyinstaller › issues › 6372
ModuleNotFoundError: No module named 'cv2' · Issue #6372 · pyinstaller/pyinstaller
November 17, 2021 - I used pyinstaller package labelme,and i have already installed opencv. After packaged,when i execute it , i got the error: ModuleNotFoundError: No module named 'cv2' How to solve it ?
Author   pyinstaller
🌐
JanBask Training
janbasktraining.com › community › python-python › modulenotfounderror-no-module-named-cv21
ModuleNotFoundError No Module Named Cv2 | JanBask Training Community
November 16, 2022 - The "Module Not Found" error, specifically "No Module Named Cv2," typically occurs when trying to import the OpenCV library (cv2) in Python code without it being installed in the current environment.