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 - 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 ...
Discussions

Issue "ModuleNotFoundError: No module named 'cv2'" although opencv is installed
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 · More on github.com
🌐 github.com
15
May 22, 2024
python - No module named 'cv2' on Anaconda 3.8.3 - Stack Overflow
I just Installed the latest Anaconda 3.8.3 with conda version 4.8.3 right away after I installed Anaconda, I use Jupyter Notebook then type import cv2 it says ModuleNotFoundError ... More on stackoverflow.com
🌐 stackoverflow.com
python - Cannot find module cv2 when using OpenCV - Stack Overflow
I have installed OpenCV on the Occidentalis operating system (a variant of Raspbian) on a Raspberry Pi, using this script by jayrambhia. It installed version 2.4.5. When I try import cv2 in a Python More on stackoverflow.com
🌐 stackoverflow.com
ModuleNotFoundError: No module named 'cv2'
I just installed Anaconda, downloaded ... 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
🌐
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.
🌐
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
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-cv2
ModuleNotFoundError: No module named 'cv2' in Python [Fixed] | bobbyhadz
April 8, 2024 - Copied!# 👇️ In a virtual environment or using Python 2 pip install opencv-python # 👇️ For Python 3 (could also be pip3.10 depending on your version) pip3 install opencv-python # 👇️ If you get a permissions error sudo pip3 install opencv-python pip install opencv-python --user # 👇️ If you don't have pip in your PATH environment variable python -m pip install opencv-python # 👇️ For Python 3 (could also be pip3.10 depending on your version) python3 -m pip install opencv-python # 👇️ Using py alias (Windows) py -m pip install opencv-python # 👇️ For Anaconda conda install -c conda-forge opencv # 👇️ For Jupyter Notebook !pip install opencv-python
🌐
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.
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 ...
🌐
GitHub
github.com › CompVis › stable-diffusion › issues › 173
ModuleNotFoundError: No module named 'cv2' · Issue #173 · CompVis/stable-diffusion
September 3, 2022 - It seemed to fix my problem. It seems like to use conda to install opencv-python you have to use an unofficial channel which I'm not stoked about, but using pip is another option.
Author   CompVis
🌐
sebhastian
sebhastian.com › modulenotfounderror-no-module-named-cv2
How to fix ModuleNotFoundError: No module named 'cv2' in Python | sebhastian
May 26, 2023 - To resolve this error, you need to install the opencv-python library using the pip install command: pip install opencv-python # For pip3: pip3 install opencv-python · Note that the package name is different than the module name.
🌐
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 ...
🌐
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…
🌐
GitHub
github.com › conda-forge › opencv-feedstock › issues › 111
ModuleNotFoundError: No module named 'cv2' · Issue #111 · conda-forge/opencv-feedstock
May 23, 2018 - 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
🌐
JanBask Training
janbasktraining.com › community › python-python › modulenotfounderror-no-module-named-cv21
ModuleNotFoundError No Module Named Cv2 | JanBask Training Community
November 16, 2022 - Regarding modulenotfounderror no module named cv2 This error may occur if you didn't install opencv module in your system. So first check this module is available or not. ... If it is not available, then install this module.
🌐
PyiHub
pyihub.org › home › no module named cv2 modulenotfounderror in python
No module named cv2 ModuleNotFoundError in Python
April 3, 2024 - This will upgrade the open-cv to the newest version available and you will no more get the ModuleNotFoundError: No module named cv2 error. Here we will list other alternative methods to install the OpenCV module on your system. # using conda install conda install -c https://conda.binstar.org/menpo opencv # using conda install conda install opencv # using conda install conda install -c conda-forge opencv # using pip install pip install opencv-contrib-python # using sudo version sudo apt install python-opencv # for python 3 pip install opencv-python3 # for python 2 pip install opencv-python #using pip install pip install cv2
🌐
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. ... $ conda install -c anaconda opencv=3.4.1 Fetching package metadata .............
Author   ContinuumIO
🌐
Easy Tweaks
easytweaks.com › no-module-named-cv2-python
no module named cv2 in Python?
Master meetings, chats, channels and online collaboration · Go beyond the basics in Word, Excel, PowerPoint and Outlook
🌐
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
🌐
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 - If you are a python programmer and you are unable to install OpenCV, then this post is for you. importerror no module named cv2 error occurs when cv2 module is not properly installed or its path is not properly set or configured.