Why can't I import opencv3 even though the package is installed?

Viewed 15167

I currently am running Python 3.5 and using Spyder from Anaconda as my IDE. I am running this on a Windows machine.

When I write import cv3 at the top of my code, it returns the error ImportError: No module named 'cv3'

I attempted to install opencv3 again with the command conda install -c https://conda.binstar.org/menpo opencv3 in the Command Prompt. It is apparently already installed because it returned

Fetching package metabase...............
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Users\Joey\Anaconda3:
# opencv3       3.1.0       py35_0      https://conda.binstar.org/menpo

Am I importing cv3 wrong? How do I fix this error?


Update: Tried import cv3 instead of import cv2 but got the following error: ImportError: cannot import name 'cv2'. The wording on the two errors is different, so python must acknowledge there is opencv installed but it does not work for some reason. Any ideas?

4 Answers

Elaborating on @zwer's answer, check the version of OpenCV after import cv2.

>>> cv2.__version__
'3.1.0'

So basically it's calling the OpenCV3 library.

Related