'no module named cv2' import error on pytorch
I am currently studying Pytorch and trying to use the cv2 module. I am using Jupyter notebook and Windows.

I have installed opencv like this: 

!pip install opencv-python


When I choose the kernel (by change kernel option) Python3 and import cv2 then there is no problem.

But when I choose the kernel Pytorch and import cv2, then there is an error:

ModuleNotFoundError: No module named 'cv2'


This must be a basic question but I can't find out what the problem is.

I found the answer to this problem here:


  First do run these commands
  
  $ conda update anaconda-navigator
  
  $ conda update navigator-updater
  
  then the issue for the instruction below will be resolved


For windows if you have anaconda installed, you can simply do:

pip install opencv-python


or

conda install -c https://conda.binstar.org/menpo opencv


If you're on linux you can do :

pip install opencv-python


or

conda install opencv 

