0

Hello all i am trying to install opencv with brew for studing image vision etc. And i am a new this thigs i found this tutorial and try to finish the steps for installing the opencv with python via this link https://www.learnopencv.com/install-opencv3-on-macos/

but in last step i get this error

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-c8ec22b3e787> in <module>()
----> 1 import cv2

ModuleNotFoundError: No module named 'cv2'

what is wrong and how can i fix it ? Any one can help me ? Have a nice day

bfontaine
  • 18,169
  • 13
  • 73
  • 107
  • Did you activate your virtual environment (by using `workon ` or `source activate ` or just `activate `)? If you enter a virtual environment successfully you should see the name of the virtual environment in parentheses in your terminal. You need to open up python *from this virtual environment*. How are you running your code? – alkasm May 25 '18 at 18:59
  • I wrote this code 'workon facecourse-py3' than try to import the lib. – Mertalp Tasdelen May 25 '18 at 19:06
  • How are you running the code? You say you try to import the lib. Do you do that via a python interpreter? Is the interpreter launched from the same terminal window that you did `workon` in? Or are you using a text editor? IDE? – alkasm May 25 '18 at 21:36
  • after choosing my workon env. i typed ipython i solved the problem by typing `pip install opencv-python` but i know it's a temporary solution i think :/ – Mertalp Tasdelen May 25 '18 at 22:39
  • 1
    Try follow the steps [here](https://stackoverflow.com/questions/42994813/installing-opencv-on-windows-10-with-python-3-6-and-anaconda-3-6/45350358#45350358) – lucians May 26 '18 at 01:17

0 Answers0