1

I have code that requires: import cv2

but get the error message: Exception has occurred: ModuleNotFoundError No module named 'cv2'

I have seen exactly the same question before, but all the suggestions fail. The question is 6 years old and hence am repeating it.

various failed suggestions:

conda install --channel https://conda.anaconda.org/menpo opencv3

conda install -c menpo opencv

I am using Windows 10 and have python 3.8.1 running.

Community
  • 1
  • 1
D.L
  • 4,339
  • 5
  • 22
  • 45
  • `pip3 install opencv-python` –  Jan 21 '20 at 22:40
  • Tried `pip3 install opencv-python` but did not work. Believe its not good practice to mix pip and conda due to package dependencies (please correct if wrong on that). – D.L Jan 22 '20 at 08:36
  • Have you seen https://stackoverflow.com/a/30281466/5386938 –  Jan 22 '20 at 21:46
  • yes, visited that page before comment was made. This is not a solution, but i eliminated cv2 from the code... – D.L Jan 23 '20 at 23:44

1 Answers1

0

I have removed cv2 from the code which works without error and resolves the issue.

The link here (at time of writing, version 4.1.2.3) describes the opencv-python package: opencv-python link

With the following description of cv2 towards the bottom of the page:

It's easier for users to understand opencv-python than cv2 and it makes it easier to find the package with search engines. cv2 (old interface in old OpenCV versions was named as cv) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet. Changing the import name or behaviour would be also confusing to experienced users who are accustomed to the import cv2.

D.L
  • 4,339
  • 5
  • 22
  • 45