在jupyter中Python导入cv2错误适用于mac终端

时间:2016-11-05 20:05:44

标签: python macos opencv

我很难在jupyter笔记本上导入cv2 。但是,当我输入:

import cv2 
在mac终端中没有错误。

我引用post 1来识别jupyter笔记本是指python3.5文件路径,其中导入工作正常的mac终端是指python 2.7文件路径。

我在post 2中引用的jupyter笔记本中输入以下内容来解决问题,但我仍然收到错误:

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

enter image description here

任何帮助都非常感谢!

1 个答案:

答案 0 :(得分:1)

我不认为你可以在python 3.5中使用python 2.7的模块,所以你要么必须在python3环境中安装cv2,要么让jupyter使用python2

相关问题