opencv is not compatible with python 3. I had to install opencv3 for python 3. The marked answer in how could we install opencv on anaconda? explains how to install opencv(3) for anaconda:

Run the following command:

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

I realized that opencv3 is also available now, run the following command:

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

Edit on Aug 18, 2016: You may like to add the "menpo" channel permanently by:

conda config --add channels menpo

And then opencv can be installed by:

conda install opencv (or opencv3)

Edit on Aug 14, 2017: "clinicalgraphics" channel provides relatively newer vtk version for very recent python3

conda install -c clinicalgraphics vtk

Edit on April 16, 2020 (based on @AMC's comment): OpenCV can be installed through conda-forge (details see here)

conda install -c conda-forge opencv

Answer from Linda on Stack Overflow
🌐
Python.org
discuss.python.org › python help
Installed opencv but having trouble importing it - Python Help - Discussions on Python.org
April 7, 2024 - Now, when I type import cv2 in my .py file, I get the following error: ModuleNotFoundError: No module named 'cv2' I’m a beginner, so I really don’t know what is happening. Here are some things that can maybe help: where pip C:\Users\Lildu\anaconda3\Scripts\pip.exe where python ...
Discussions

ModuleNotFoundError: No module named 'cv2'
I just installed Anaconda, downloaded the repo, and activated conda, all per docs/the readme. I'm getting this: (ldm)...$ python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms Traceback (most recent call last): File "/home/c/.code/lab/stable-diffusion/scripts/txt2img.py", line 2, in import cv2 ModuleNotFoundError: No module named ... More on github.com
🌐 github.com
1
September 3, 2022
cannot import cv2 module after installing opencv 3.4.1 from anaconda
Actual Behavior $ python -c 'import cv2' Traceback (most recent call last): File " ", line 1, in ModuleNotFoundError: No module named 'cv2' Exp... More on github.com
🌐 github.com
4
May 25, 2018
python - Anaconda 'ModuleNotFoundError: No module named cv2' - Stack Overflow
I am currently trying to run code from the following GitHub repo on my computer: https://github.com/andresberejnoi/ComputerVision I have Anaconda3 installed and have used the prompt to create a vir... More on stackoverflow.com
🌐 stackoverflow.com
June 20, 2022
Import cv2 Import error : module not found - Product Help - Anaconda Forum
Hi, I am new to Anaconda and Opencv. This is my first installation on Windows 11. Using Anaconda3-2024.02-1-Windows-x86_64 .exe the installation to the default folder completed normally without adding Anaconda3 to my PATH environment variable, and updated to Anaconda 2.6.0, Then, I installed ... More on forum.anaconda.com
🌐 forum.anaconda.com
0
April 26, 2024
🌐
JetBrains
youtrack.jetbrains.com › issue › PY-21345 › No-module-named-cv2-if-OpenCV-is-installed-with-Anaconda
No module named cv2 if OpenCV is installed with Anaconda
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
GitHub
github.com › CompVis › stable-diffusion › issues › 173
ModuleNotFoundError: No module named 'cv2' · Issue #173 · CompVis/stable-diffusion
September 3, 2022 - Which seems to stem from line 15 in environment.yaml (I guess opencv is cv2): ... $ conda search opencv-python Loading channels: done No match found for: opencv-python. Search: *opencv-python* PackagesNotFoundError: The following packages are not available from current channels: - opencv-python Current channels: - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.
Author   CompVis
🌐
GitHub
github.com › ContinuumIO › anaconda-issues › issues › 9448
cannot import cv2 module after installing opencv 3.4.1 from anaconda · Issue #9448 · ContinuumIO/anaconda-issues
May 25, 2018 - $ python -c 'import cv2' Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'cv2' It should import cv2 module without errors. By the way, it seems to work if I install opencv 3.3.1 from anaconda channel.
Author   ContinuumIO
🌐
Stack Overflow
stackoverflow.com › questions › 72689908 › anaconda-modulenotfounderror-no-module-named-cv2
python - Anaconda 'ModuleNotFoundError: No module named cv2' - Stack Overflow
June 20, 2022 - I have Anaconda3 installed and have used the prompt to create a virtual environment. However, no matter which commands I try, it flags an error at the line of code 'import cv2', saying the module cannot be found.
Find elsewhere
🌐
Researchdatapod
researchdatapod.com › home › how to solve python modulenotfounderror: no module named ‘cv2’
How to Solve Python ModuleNotFoundError: no module named 'cv2' - The Research Scientist Pod
August 2, 2022 - The modulenotfounderror occurs if you misspell the module name, incorrectly point to the module path or do not have the module installed in your Python environment. If you do not have the module installed in your Python environment, you can ...
🌐
Data Science Learner
datasciencelearner.com › importerror-no-module-named-cv2-fix
Importerror No Module Named cv2 : How to Fix ? - Data Science Learner
October 2, 2023 - The straight-way fix for this error (no module named cv2) is to reinstall this module (OpenCV-python).
🌐
Anaconda Forum
forum.anaconda.com › product help
Import cv2 Import error : module not found - Product Help - Anaconda Forum
April 26, 2024 - Hi, I am new to Anaconda and Opencv. This is my first installation on Windows 11. Using Anaconda3-2024.02-1-Windows-x86_64 .exe the installation to the default folder completed normally without adding Anaconda3 to my PATH environment variable, and updated to Anaconda 2.6.0, Then, I installed ...
🌐
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
🌐
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

🌐
GitHub
github.com › conda-forge › opencv-feedstock › issues › 111
ModuleNotFoundError: No module named 'cv2' · Issue #111 · conda-forge/opencv-feedstock
May 23, 2018 - ModuleNotFoundError: No module named 'cv2'#111 · Copy link · ayushgargdroid · opened · on May 23, 2018 · Issue body actions · OpenCV 3.4 doesn't seem to work, but OpenCV 3.1.0 works flawlessly. I am using Python 3.6.4 on Ubuntu 16.04. I installed OpenCV in a separate new conda environment - conda install opencv ·
Author   conda-forge
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-cv2
ModuleNotFoundError: No module named 'cv2' in Python [Fixed] | bobbyhadz
April 8, 2024 - If the error persists, make sure you haven't named a module in your project as cv2.py because that would shadow the original opencv-python module. You also shouldn't be declaring a variable named opencv-python as that would also shadow the original ...
🌐
PyPI
pypi.org › project › opencv-python
opencv-python · PyPI
If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see this issue for a manual fix. If you still encounter the error after you have checked all the previous solutions, download Dependencies and open the cv2.pyd (located usually at C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2) file with it to debug missing DLL issues.
      » pip install opencv-python
    
Published   Feb 05, 2026
Version   4.13.0.92
🌐
PyiHub
pyihub.org › home › no module named cv2 modulenotfounderror in python
No module named cv2 ModuleNotFoundError in Python
April 3, 2024 - If you already have installed OpenCV but still getting ModuleNotFoundError: No module named cv2 error when trying to import the module, then you need to uninstall the installed version and then again install the OpenCV module.
🌐
Position Is Everything
positioniseverything.net › home › modulenotfounderror: no module named ‘cv2’: we repaired it
Modulenotfounderror: No Module Named ‘CV2’: We Repaired It - Position Is Everything
November 12, 2025 - In addition, the modulenotfounderror no module named ‘cv2’ PyCharm error log is standard when running incompatible Python versions on your remote and current repository, failing to initiate the import cv code snippet.
🌐
Saturn Cloud
saturncloud.io › blog › solving-the-no-module-named-cv2-error-in-anaconda-383
Saturn Cloud | Saturn Cloud | The Control Plane for GPU Clouds
August 8, 2023 - Isolation happens at the hardware boundary, not inside a shared control plane. Each customer gets their own Kubernetes or Slurm cluster, their own InfiniBand P_Key, and their own storage namespace.
🌐
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…