Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import OpenCV on jupyter notebook

I tried installing OpenCV on Windows 10 using pip. I used this command- pip install opencv-contrib-python

After that when I tried importing cv2 on command prompt, it was successfully imported- Importing cv2 successfully through command prompt

When I tried importing it on jupyter notebook, this error popped up- Error when importing cv2 on jupyter notebook

This is the python version I'm using- Python version that I am using

This is pip list and as I've highlighted, opencv-contrib-python version 3.4.3.18 is installed- pip list

Then why can't I import OpenCV on jupyter notebook, like tensorflow or numpy are also in pip list and I'm able to import them both through command prompt and also on jupyter notebook.

Please help. Thanks a lot.

like image 226
guptasaanika Avatar asked Oct 16 '18 10:10

guptasaanika


People also ask

How do I import OpenCV into Jupyter Notebook?

Type the command “pip install opencv-python” to install python lib You should see 'Successfully installed' to finish installing opencv-python. 7. Use Jupyter notebook to run python code Open the Windows Start menu in your Desktop, click “Anaconda3 (64-bit)”, and then click “Jupyter Notebook(anaconda3)”.

Is Jupyter Notebook good for OpenCV?

Facial Landmark Detection using OpenCV and Dlib in C++ Jupyter Notebook, formerly known as IPython Notebook, in my opinion, is one of the best tools for a programmer.

How do I import OpenCV into Anaconda?

Step 1:- After installing the anaconda open the Anaconda Prompt. Step 2:- Type the given command, press enter, and let it download the whole package. Step 3:- Now simply import OpenCV in your python program in which you want to use image processing functions.


1 Answers

You have installed openCV in Python running on your Terminal, not into the working environment which Jupyter Notebooks is running from.

Whilst in Terminal write:

py -m pip install opencv-python

When you use pip list

You should see opencv-python 3.4.3.18

More information here.

like image 66
Michael Muttiah Avatar answered Oct 26 '22 14:10

Michael Muttiah