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:
Answer from Linda on Stack OverflowRun the following command:
conda install -c https://conda.binstar.org/menpo opencvI realized that opencv3 is also available now, run the following command:
conda install -c https://conda.binstar.org/menpo opencv3Edit on Aug 18, 2016: You may like to add the "menpo" channel permanently by:
conda config --add channels menpoAnd 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 vtkEdit 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
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 opencvI realized that opencv3 is also available now, run the following command:
conda install -c https://conda.binstar.org/menpo opencv3Edit on Aug 18, 2016: You may like to add the "menpo" channel permanently by:
conda config --add channels menpoAnd 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 vtkEdit 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
Use this code at the Anaconda prompt:
Copyconda update conda -c conda-canary
Then don't type this code:
Copyconda install -c conda-forge opencv
but, instead, use:
CopyPip install opencv-python
It worked with me after few days of trials
See Krishna Ojha's video and read the comments below the video.
ModuleNotFoundError: No module named 'cv2'
cannot import cv2 module after installing opencv 3.4.1 from anaconda
python - Anaconda 'ModuleNotFoundError: No module named cv2' - Stack Overflow
Import cv2 Import error : module not found - Product Help - Anaconda Forum
Videos
Just open your command prompt with run as administrator. And try,
conda install -c conda-forge opencv
I was getting this error when using the command conda install -c menpo opencv
Specifications:
- opencv -> python[version='2.7.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0'] Your python: python=3.8 .So,by using pip it got solved.
pip install opencv-contrib-python
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
» pip install opencv-python