0

I am having difficulty importing cv2 on jupyter notebook. However, when I enter:

import cv2 

in the mac terminal there is no error.

I referenced post 1 to identify that jupyter notebook refers to python3.5 file path where as mac terminal where the import works fine refers to python 2.7 file path.

I entered the below in jupyter notebook as referenced in post 2 to solve the issue, but I'm still getting an error:

import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import cv2

enter image description here

Any help greatly appreciated!

Community
  • 1
  • 1
Ariel
  • 928
  • 4
  • 15
  • 32

1 Answers1

1

I don't think you can use a module for python 2.7 in python 3.5, so you'll either have to install cv2 in your python3 environment or get jupyter to use python2

Maarten Fabré
  • 6,938
  • 1
  • 17
  • 36