Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'cv2.cv2'

Tags:

python

opencv

I am a beginner at computers. I use Anaconda python 3.6 in windows 10. I have already installed OpenCV using this command:

pip install opencv-python

But when I try to import cv2 using this:

import cv2

this error shows up:

cv2 error

How can I install openCV for python?

like image 448
Hadi GhahremanNezhad Avatar asked Mar 26 '19 15:03

Hadi GhahremanNezhad


1 Answers

Based on python opencv link: https://pypi.org/project/opencv-python/

Step 1: Uninstall the opencv first if you have previous/other manually installed (= not installed via pip) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages)):

pip uninstall opencv-python

Step 2: Install the package afresh

pip install opencv-python

Hope that works!

like image 111
Mohamed Imran Avatar answered Sep 20 '22 19:09

Mohamed Imran