ModuleNotFoundError: No module named 'cv2' in jupyter, how to fix it?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Artificial Intelligence, Machine Learning, & Deep LearningModuleNotFoundError: No module named 'cv2' in jupyter, how to fix it?
Chetan Shidling Staff asked 5 years ago

Here is the code:
 

import numpy as np
import matplotlib
import cv2
from matplotlib import pyplot as plt
%matplotlib inline


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-8-f0bf904db36f> in <module>
      1 import numpy as np
      2 import matplotlib
----> 3 import cv2
      4 from matplotlib import pyplot as plt
      5 get_ipython().run_line_magic('matplotlib', 'inline')

ModuleNotFoundError: No module named 'cv2'
1 Answers
Chetan Shidling Staff answered 5 years ago

First, insert one cell above and then type:
 
!pip install opencv-python
 
It will work.